Эх сурвалжийг харах

Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/notify

# Conflicts:
#	sql/mysql/ruoyi-vue-pro.sql
#	yudao-ui-admin/src/utils/dict.js
YunaiV 2 жил өмнө
parent
commit
143035d798
100 өөрчлөгдсөн 8863 нэмэгдсэн , 1127 устгасан
  1. 106 71
      README.md
  2. 2 2
      http-client.env.json
  3. 19 9
      pom.xml
  4. 7 4
      sql/mysql/optional/jimureport.mysql5.7.create.sql
  5. 118 0
      sql/mysql/optional/mp.sql
  6. 6 2
      sql/mysql/optional/vue3-menu.sql
  7. 822 135
      sql/mysql/ruoyi-vue-pro.sql
  8. 0 287
      sql/optional/mall/mall.sql
  9. 214 186
      sql/oracle/ruoyi-vue-pro.sql
  10. 101 83
      sql/postgresql/ruoyi-vue-pro.sql
  11. 130 101
      sql/sqlserver/ruoyi-vue-pro.sql
  12. 114 59
      yudao-dependencies/pom.xml
  13. 22 0
      yudao-example/pom.xml
  14. 65 0
      yudao-example/yudao-sso-demo-by-code/pom.xml
  15. 13 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/SSODemoApplication.java
  16. 157 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/OAuth2Client.java
  17. 73 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/UserClient.java
  18. 28 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/CommonResult.java
  19. 45 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2AccessTokenRespDTO.java
  20. 59 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2CheckTokenRespDTO.java
  21. 97 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserInfoRespDTO.java
  22. 35 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserUpdateReqDTO.java
  23. 63 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java
  24. 40 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/UserController.java
  25. 52 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java
  26. 37 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/LoginUser.java
  27. 66 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java
  28. 44 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AccessDeniedHandlerImpl.java
  29. 36 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AuthenticationEntryPointImpl.java
  30. 103 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/SecurityUtils.java
  31. 28 0
      yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/ServletUtils.java
  32. 2 0
      yudao-example/yudao-sso-demo-by-code/src/main/resources/application.yaml
  33. 61 0
      yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html
  34. 159 0
      yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html
  35. 65 0
      yudao-example/yudao-sso-demo-by-password/pom.xml
  36. 13 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/SSODemoApplication.java
  37. 127 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/OAuth2Client.java
  38. 73 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/UserClient.java
  39. 28 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/CommonResult.java
  40. 45 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2AccessTokenRespDTO.java
  41. 59 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2CheckTokenRespDTO.java
  42. 97 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserInfoRespDTO.java
  43. 35 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserUpdateReqDTO.java
  44. 50 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java
  45. 40 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/controller/UserController.java
  46. 52 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java
  47. 37 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/LoginUser.java
  48. 66 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java
  49. 44 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AccessDeniedHandlerImpl.java
  50. 36 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AuthenticationEntryPointImpl.java
  51. 103 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/SecurityUtils.java
  52. 28 0
      yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/ServletUtils.java
  53. 2 0
      yudao-example/yudao-sso-demo-by-password/src/main/resources/application.yaml
  54. 154 0
      yudao-example/yudao-sso-demo-by-password/src/main/resources/static/index.html
  55. 74 0
      yudao-example/yudao-sso-demo-by-password/src/main/resources/static/login.html
  56. 4 1
      yudao-framework/pom.xml
  57. 5 0
      yudao-framework/yudao-common/pom.xml
  58. 0 1
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java
  59. 2 1
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DocumentEnum.java
  60. 40 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java
  61. 1 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java
  62. 2 1
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java
  63. 17 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java
  64. 1 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/SetUtils.java
  65. 57 22
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java
  66. 63 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java
  67. 2 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java
  68. 2 2
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java
  69. 8 0
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java
  70. 4 6
      yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/validation/ValidationUtils.java
  71. 2 2
      yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java
  72. 0 2
      yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring.factories
  73. 1 0
      yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  74. 3 4
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java
  75. 2 2
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
  76. 211 80
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java
  77. 3 3
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
  78. 0 3
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/resources/META-INF/spring.factories
  79. 2 0
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  80. 1 1
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java
  81. 205 42
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest2.java
  82. 1 1
      yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRuleTest.java
  83. 2 2
      yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java
  84. 4 4
      yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java
  85. 0 2
      yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories
  86. 1 0
      yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  87. 2 2
      yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java
  88. 2 2
      yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java
  89. 0 2
      yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring.factories
  90. 1 0
      yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  91. 58 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml
  92. 55 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java
  93. 39 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/enums/AreaTypeEnum.java
  94. 119 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java
  95. 87 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java
  96. 11 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java
  97. 3608 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv
  98. BIN
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/ip2region.xdb
  99. 36 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java
  100. 47 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtilsTest.java

+ 106 - 71
README.md

@@ -1,6 +1,4 @@
-**严肃声明:现在、未来都不会有商业版本,所有功能全部开源!**
-
-**拒绝虚假开源,售卖商业版,程序员不骗程序员!!**
+**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!**
 
 **「我喜欢写代码,乐此不疲」**  
 **「我喜欢做开源,以此为乐」**
@@ -23,9 +21,11 @@
 >
 > 😜 给项目点点 Star 吧,这对我们真的很重要!
 
+![架构图](https://static.iocoder.cn/ruoyi-vue-pro-architecture.png)
+
 * 管理后台的 Vue3 版本采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) ,Vue2 版本采用 [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) 
 * 管理后台的移动端采用 [uni-app](https://github.com/dcloudio/uni-app) 方案,一份代码多终端适配,同时支持 APP、小程序、H5!
-* 后端采用 Spring Boot、MySQL + MyBatis Plus、Redis + Redisson
+* 后端采用 Spring Boot 多模块架构、MySQL + MyBatis Plus、Redis + Redisson
 * 数据库可使用 MySQL、Oracle、PostgreSQL、SQL Server、MariaDB、国产达梦 DM、TiDB 等
 * 权限认证使用 Spring Security & Token & Redis,支持多终端、多种用户的认证系统,支持 SSO 单点登录
 * 支持加载动态权限菜单,按钮级别权限控制,本地缓存提升性能
@@ -33,25 +33,42 @@
 * 工作流使用 Flowable,支持动态表单、在线设计流程、会签 / 或签、多种任务分配方式
 * 高效率开发,使用代码生成器可以一键生成前后端代码 + 单元测试 + Swagger 接口文档 + Validator 参数校验
 * 集成微信小程序、微信公众号、企业微信、钉钉等三方登陆,集成支付宝、微信等支付与退款
-* 集成阿里云、腾讯云、云片等短信渠道,集成 MinIO、阿里云、腾讯云、七牛云等云存储服务
+* 集成阿里云、腾讯云等短信渠道,集成 MinIO、阿里云、腾讯云、七牛云等云存储服务
 * 集成报表设计器,支持数据报表、图形报表、打印设计等
 
-| 项目名                | 说明                     | 传说门                                                                                                                                 |
-|--------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
-| `ruoyi-vue-pro`    | Spring Boot 多模块        | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)**     [Github](https://github.com/YunaiV/ruoyi-vue-pro)     |
-| `yudao-cloud`  | Spring Cloud 微服务       | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)**     [Github](https://github.com/YunaiV/yudao-cloud)         |
-| `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)**     [Github](https://github.com/YunaiV/SpringBoot-Labs) |
+| 项目名                  | 说明                     | 传送门                                                                                                                                 |
+|----------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
+| `ruoyi-vue-pro`      | Spring Boot 多模块        | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)**     [Github](https://github.com/YunaiV/ruoyi-vue-pro)     |
+| `yudao-cloud`        | Spring Cloud 微服务       | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)**     [Github](https://github.com/YunaiV/yudao-cloud)         |
+| `Spring-Boot-Labs`   | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)**     [Github](https://github.com/YunaiV/SpringBoot-Labs) |
+ | `ruoyi-vue-pro-mini` | 精简版:移除工作流、支付等模块        | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/mini)**                                                                |
+
+## 😎 开源协议
+
+**为什么推荐使用本项目?**
+
+① 本项目采用比 Apache 2.0 更宽松的 [MIT License](https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE) 开源协议,个人与企业可 100% 免费使用,不用保留类作者、Copyright 信息。
+
+② 代码全部开源,不会像其他项目一样,只开源部分代码,让你无法了解整个项目的架构设计。[国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn)
 
+![开源项目对比](https://static.iocoder.cn/project-vs.png?imageView2/2/format/webp/w/1280)
+
+③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,57000 行 Java 代码,22000 行代码注释。
 
 ## 🐼 内置功能
 
-分成多种内置功能:
+系统内置多种多种业务功能,可以用于快速你的业务系统:
+
+![功能分层](https://static.iocoder.cn/ruoyi-vue-pro-biz.png)
+
 * 系统功能
 * 基础设施
 * 工作流程
 * 支付系统
-* 商城系统
+* 会员中心
 * 数据报表
+* 商城系统
+* 微信公众号
 
 > 友情提示:本项目基于 RuoYi-Vue 修改,**重构优化**后端的代码,**美化**前端的界面。
 >
@@ -73,13 +90,15 @@
 | 🚀  | 租户管理  | 配置系统租户,支持 SaaS 场景下的多租户功能        |
 | 🚀  | 租户套餐  | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限       |
 |     | 字典管理  | 对系统中经常使用的一些较为固定的数据进行维护          |
-| 🚀  | 短信管理  | 短信渠道、短息模板、短信日志,对接阿里云、云片等主流短信平台  |
+| 🚀  | 短信管理  | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 |
+| 🚀  | 邮件管理  | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台       |
 | 🚀  | 操作日志  | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 |
 | ⭐️  | 登录日志  | 系统登录日志记录查询,包含登录异常               |
 | 🚀  | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务     |
 |     | 通知公告  | 系统通知公告信息发布维护                    |
-| 🚀  | 敏感词  | 配置系统敏感词,支持标签分组                    |
+| 🚀  | 敏感词   | 配置系统敏感词,支持标签分组                  |
 | 🚀  | 应用管理  | 管理 SSO 单点登录的应用,支持多种 OAuth2 授权方式 |
+| 🚀  | 地区管理  | 展示省份、城市、区镇等城市信息,支持 IP 对应城市      |
 
 ### 工作流程
 
@@ -114,7 +133,7 @@ ps:核心功能已经实现,正在对接微信小程序中...
 |     | 表单构建     | 拖动表单元素生成相应的 HTML 代码,支持导出 JSON、Vue 文件         |
 | 🚀  | 配置管理     | 对系统动态配置常用参数,支持 SpringBoot 加载                 |
 | ⭐️  | 定时任务     | 在线(添加、修改、删除)任务调度包含执行结果日志                     |
-| 🚀  | 文件服务     | 支持将文件存储到 S3(MinIO、阿里云、腾讯云、七牛云)、本地、FTP、数据库等      | 
+| 🚀  | 文件服务     | 支持将文件存储到 S3(MinIO、阿里云、腾讯云、七牛云)、本地、FTP、数据库等   | 
 | 🚀  | API 日志   | 包括 RESTful API 访问日志、异常日志两部分,方便排查 API 相关的问题   |
 |     | MySQL 监控 | 监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈              |
 |     | Redis 监控 | 监控 Redis 数据库的使用情况,使用的 Redis Key 管理           |
@@ -135,6 +154,21 @@ ps:核心功能已经实现,正在对接微信小程序中...
 | 🚀  | 报表设计器     | 支持数据报表、图形报表、打印设计等       |
 | 🚀  | 大屏设计器     | 建设中... 拖拽式实现可视化数据大屏          |
 
+### 微信公众号
+
+|     | 功能     | 描述                            |
+|-----|--------|-------------------------------|
+| 🚀  | 账号管理   | 配置接入的微信公众号,可支持多个公众号           |
+| 🚀  | 数据统计   | 统计公众号的用户增减、累计用户、消息概况、接口分析等数据  |
+| 🚀  | 粉丝管理   | 查看已关注、取关的粉丝列表,可对粉丝进行同步、打标签等操作 |
+| 🚀  | 消息管理   | 查看粉丝发送的消息列表,可主动回复粉丝消息         |
+| 🚀  | 自动回复   | 自动回复粉丝发送的消息,支持关注回复、消息回复、关键字回复 |
+| 🚀  | 标签管理   | 对公众号的标签进行创建、查询、修改、删除等操作       |
+| 🚀  | 菜单管理   | 自定义公众号的菜单,也可以从公众号同步菜单         |
+| 🚀  | 素材管理   | 管理公众号的图片、语音、视频等素材,支持在线播放语音、视频 |
+| 🚀  | 图文草稿箱  | 新增常用的图文素材到草稿箱,可发布到公众号         |
+| 🚀  | 图文发表记录 | 查看已发布成功的图文素材,支持删除操作           |
+
 ### 商城系统
 
 建设中...
@@ -151,89 +185,90 @@ ps:核心功能已经实现,正在对接微信小程序中...
 
 ## 🐨 技术栈
 
-| 项目                    | 说明                 |
-|-----------------------|--------------------|
-| `yudao-dependencies`  | Maven 依赖版本管理       |
-| `yudao-framework`     | Java 框架拓展          |
-| `yudao-server`        | 管理后台 + 用户 APP 的服务端 |
-| `yudao-ui-admin`      | 管理后台的 Vue2 前端项目        |
-| `yudao-ui-admin-vue3`      | 管理后台的 Vue3 前端项目        |
-| `yudao-ui-admin-uniapp`      | 管理后台的 uni-app 多端项目        |
-| `yudao-ui-app`       | 用户 APP 的 UI 界面     |
-| `yudao-module-system` | 系统功能的 Module 模块    |
-| `yudao-module-member` | 会员中心的 Module 模块    |
-| `yudao-module-infra`  | 基础设施的 Module 模块    |
-| `yudao-module-tool`   | 研发工具的 Module 模块    |
-| `yudao-module-bpm`    | 工作流程的 Module 模块    |
-| `yudao-module-pay`    | 支付系统的 Module 模块    |
+| 项目                           | 说明                 |
+|------------------------------|--------------------|
+| `yudao-dependencies`         | Maven 依赖版本管理       |
+| `yudao-framework`            | Java 框架拓展          |
+| `yudao-server`               | 管理后台 + 用户 APP 的服务端 |
+| `yudao-ui-admin`             | 管理后台的 Vue2 前端项目    |
+| `yudao-ui-admin-vue3`        | 管理后台的 Vue3 前端项目    |
+| `yudao-ui-admin-uniapp`      | 管理后台的 uni-app 多端项目 |
+| `yudao-ui-app`               | 用户 APP 的 UI 界面     |
+| `yudao-module-system`        | 系统功能的 Module 模块    |
+| `yudao-module-member`        | 会员中心的 Module 模块    |
+| `yudao-module-infra`         | 基础设施的 Module 模块    |
+| `yudao-module-bpm`           | 工作流程的 Module 模块    |
+| `yudao-module-pay`           | 支付系统的 Module 模块    |
+| `yudao-module-mall`          | 商城系统的 Module 模块    |
+| `yudao-module-mp`            | 微信公众号的 Module 模块   |
+| `yudao-module-visualization` | 大屏报表 Module 模块     |
 
 ### 后端
 
-| 框架                                                                                         | 说明                   | 版本      | 学习指南                                                           |
-|---------------------------------------------------------------------------------------------|-----------------------|-----------|----------------------------------------------------------------|
-| [Spring Boot](https://spring.io/projects/spring-boot)                                       | 应用开发框架             | 2.6.10    | [文档](https://github.com/YunaiV/SpringBoot-Labs)                |
-| [MySQL](https://www.mysql.com/cn/)                                                          | 数据库服务器             | 5.7      |                                                                |
-| [Druid](https://github.com/alibaba/druid)                                                   | JDBC 连接池、监控组件     | 1.2.11    | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
-| [MyBatis Plus](https://mp.baomidou.com/)                                                    | MyBatis 增强工具包       | 3.5.2    | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao)         |
-| [Dynamic Datasource](https://dynamic-datasource.com/)                                       | 动态数据源               | 3.5.0    | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
-| [Redis](https://redis.io/)                                                                  | key-value 数据库        | 5.0      |                                                                |
-| [Redisson](https://github.com/redisson/redisson)                                            | Redis 客户端            | 3.17.4   | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao)           |
-| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架               | 5.3.20    | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao)               |
-| [Spring Security](https://github.com/spring-projects/spring-security)                       | Spring 安全框架         | 5.6.5    | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |
-| [Hibernate Validator](https://github.com/hibernate/hibernate-validator)                     | 参数校验组件             | 6.2.3    | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao)      |
-| [Flowable](https://github.com/flowable/flowable-engine)                                     | 工作流引擎               | 6.7.0    | [文档](https://doc.iocoder.cn/bpm/)                                                     |
-| [Quartz](https://github.com/quartz-scheduler)                                               | 任务调度组件             | 2.3.2    | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao)             |
-| [Knife4j](https://gitee.com/xiaoym/knife4j)                                                 | Swagger 增强 UI 实现    | 3.0.3    | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao)         |
-| [Resilience4j](https://github.com/resilience4j/resilience4j)                                | 服务保障组件             | 1.7.1    | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao)    |
-| [SkyWalking](https://skywalking.apache.org/)                                                | 分布式应用追踪系统        | 8.5.0    | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao)      |
-| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin)                       | Spring Boot 监控平台    | 2.6.7    | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao)           |
-| [Jackson](https://github.com/FasterXML/jackson)                                             | JSON 工具库             | 2.13.3   |                                                                |
-| [MapStruct](https://mapstruct.org/)                                                         | Java Bean 转换         | 1.4.1    | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao)       |
-| [Lombok](https://projectlombok.org/)                                                        | 消除冗长的 Java 代码     | 1.16.14  | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao)          |
-| [JUnit](https://junit.org/junit5/)                                                          | Java 单元测试框架        | 5.8.2    | -                                                              |
-| [Mockito](https://github.com/mockito/mockito)                                               | Java Mock 框架         | 4.0.0    | -                                                              |
+| 框架                                                                                          | 说明               | 版本          | 学习指南                                                           |
+|---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------|
+| [Spring Boot](https://spring.io/projects/spring-boot)                                       | 应用开发框架           | 2.7.7       | [文档](https://github.com/YunaiV/SpringBoot-Labs)                |
+| [MySQL](https://www.mysql.com/cn/)                                                          | 数据库服务器           | 5.7 / 8.0+  |                                                                |
+| [Druid](https://github.com/alibaba/druid)                                                   | JDBC 连接池、监控组件    | 1.2.15      | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
+| [MyBatis Plus](https://mp.baomidou.com/)                                                    | MyBatis 增强工具包    | 3.5.3.1     | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao)         |
+| [Dynamic Datasource](https://dynamic-datasource.com/)                                       | 动态数据源            | 3.6.1       | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
+| [Redis](https://redis.io/)                                                                  | key-value 数据库    | 5.0 / 6.0   |                                                                |
+| [Redisson](https://github.com/redisson/redisson)                                            | Redis 客户端        | 3.18.0      | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao)           |
+| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架           | 5.3.24      | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao)               |
+| [Spring Security](https://github.com/spring-projects/spring-security)                       | Spring 安全框架      | 5.7.6       | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |
+| [Hibernate Validator](https://github.com/hibernate/hibernate-validator)                     | 参数校验组件           | 6.2.5       | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao)      |
+| [Flowable](https://github.com/flowable/flowable-engine)                                     | 工作流引擎            | 6.8.0       | [文档](https://doc.iocoder.cn/bpm/)                              |
+| [Quartz](https://github.com/quartz-scheduler)                                               | 任务调度组件           | 2.3.2       | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao)             |
+| [Knife4j](https://gitee.com/xiaoym/knife4j)                                                 | Swagger 增强 UI 实现 | 3.0.3       | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao)         |
+| [Resilience4j](https://github.com/resilience4j/resilience4j)                                | 服务保障组件           | 1.7.1       | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao)    |
+| [SkyWalking](https://skywalking.apache.org/)                                                | 分布式应用追踪系统        | 8.12.0      | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao)      |
+| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin)                       | Spring Boot 监控平台 | 2.7.10      | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao)           |
+| [Jackson](https://github.com/FasterXML/jackson)                                             | JSON 工具库         | 2.13.3      |                                                                |
+| [MapStruct](https://mapstruct.org/)                                                         | Java Bean 转换     | 1.5.3.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao)       |
+| [Lombok](https://projectlombok.org/)                                                        | 消除冗长的 Java 代码    | 1.18.24     | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao)          |
+| [JUnit](https://junit.org/junit5/)                                                          | Java 单元测试框架      | 5.8.2       | -                                                              |
+| [Mockito](https://github.com/mockito/mockito)                                               | Java Mock 框架     | 4.8.0       | -                                                              |
 
 ### [管理后台 Vue2 前端](./yudao-ui-admin)
 
 | 框架                                                                           | 说明            | 版本     |
 |------------------------------------------------------------------------------|---------------|--------|
-| [Vue](https://cn.vuejs.org/index.html)                                       | JavaScript 框架 | 2.6.12 |
+| [Vue](https://cn.vuejs.org/index.html)                                       | JavaScript 框架 | 2.7.14 |
 | [Vue Element Admin](https://panjiachen.github.io/vue-element-admin-site/zh/) | 后台前端解决方案      | -      |
 
 ### [管理后台 Vue3 前端](./yudao-ui-admin-vue3)
 
-| 框架                                                                  | 说明               | 版本     |
-|----------------------------------------------------------------------|------------------|--------|
-| [Vue](https://staging-cn.vuejs.org/)                                 | Vue 框架           | 3.2.37 |
-| [Vite](https://cn.vitejs.dev//)                                      | 开发与构建工具          | 3.0.4  |
-| [Element Plus](https://element-plus.org/zh-CN/)                      | Element Plus     | 2.2.12 |
-| [TypeScript](https://www.typescriptlang.org/docs/)                   | TypeScript       | 4.7.4  |
-| [pinia](https://pinia.vuejs.org/)                                    | Vue 存储库 替代 vuex5 | 2.0.17 |
-| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化              | 9.2.0  |
-| [windicss](https://cn.windicss.org/)                                 | 下一代工具优先的 CSS 框架  | 3.5.6  |
-| [iconify](https://icon-sets.iconify.design/)                         | 在线图标库            | 2.2.1  |
+| 框架                                                                   |      说明      |   版本   |
+|----------------------------------------------------------------------|:------------:|:------:|
+| [Vue](https://staging-cn.vuejs.org/)                                 |    Vue 框架    | 3.2.45 |
+| [Vite](https://cn.vitejs.dev//)                                      |   开发与构建工具    | 4.0.4  |
+| [Element Plus](https://element-plus.org/zh-CN/)                      | Element Plus | 2.2.28 |
+| [TypeScript](https://www.typescriptlang.org/docs/)                   |  TypeScript  | 4.9.4  |
+| [pinia](https://pinia.vuejs.org/)                                    |    vuex5     | 2.0.28 |
+| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) |     国际化      | 9.2.2  |
+| [vxe-table](https://vxetable.cn/)                                    |   vue最强表单    | 4.3.9  |
 
 ### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp)
 
-| 框架                                                                  | 说明               | 版本     |
-|----------------------------------------------------------------------|------------------|--------|
-| [uni-app](hhttps://github.com/dcloudio/uni-app)                                 | 跨平台框架           | 2.0.0 |
-| [uni-ui](https://github.com/dcloudio/uni-ui)                                      | 基于 uni-app 的 UI 框架          | 1.4.20  |
+| 框架                                              | 说明                 | 版本     |
+|-------------------------------------------------|--------------------|--------|
+| [uni-app](hhttps://github.com/dcloudio/uni-app) | 跨平台框架              | 2.0.0  |
+| [uni-ui](https://github.com/dcloudio/uni-ui)    | 基于 uni-app 的 UI 框架 | 1.4.20 |
 
 ## 🐷 演示图
 
 ### 系统功能
 
 | 模块       | biu                                                                | biu                                                              | biu                                                              |
-|----------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|
+|------------|--------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|
 | 登录 & 首页  | ![登录](https://static.iocoder.cn/images/ruoyi-vue-pro/登录.jpg?imageView2/2/format/webp/w/1280)       | ![首页](https://static.iocoder.cn/images/ruoyi-vue-pro/首页.jpg?imageView2/2/format/webp/w/1280)     | ![个人中心](https://static.iocoder.cn/images/ruoyi-vue-pro/个人中心.jpg?imageView2/2/format/webp/w/1280) |
-| 用户 & 应用      | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280)   | ![令牌管理](https://static.iocoder.cn/images/ruoyi-vue-pro/令牌管理.jpg?imageView2/2/format/webp/w/1280) | ![应用管理](https://static.iocoder.cn/images/ruoyi-vue-pro/应用管理.jpg?imageView2/2/format/webp/w/1280)                                                                |
+| 用户 & 应用  | ![用户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/用户管理.jpg?imageView2/2/format/webp/w/1280)   | ![令牌管理](https://static.iocoder.cn/images/ruoyi-vue-pro/令牌管理.jpg?imageView2/2/format/webp/w/1280) | ![应用管理](https://static.iocoder.cn/images/ruoyi-vue-pro/应用管理.jpg?imageView2/2/format/webp/w/1280)                                                                |
 | 租户 & 套餐  | ![租户管理](https://static.iocoder.cn/images/ruoyi-vue-pro/租户管理.jpg?imageView2/2/format/webp/w/1280)   | ![租户套餐](https://static.iocoder.cn/images/ruoyi-vue-pro/租户套餐.png) | -                                                                |
 | 部门 & 岗位  | ![部门管理](https://static.iocoder.cn/images/ruoyi-vue-pro/部门管理.jpg?imageView2/2/format/webp/w/1280)   | ![岗位管理](https://static.iocoder.cn/images/ruoyi-vue-pro/岗位管理.jpg?imageView2/2/format/webp/w/1280) | -                                                                |
 | 菜单 & 角色  | ![菜单管理](https://static.iocoder.cn/images/ruoyi-vue-pro/菜单管理.jpg?imageView2/2/format/webp/w/1280)   | ![角色管理](https://static.iocoder.cn/images/ruoyi-vue-pro/角色管理.jpg?imageView2/2/format/webp/w/1280) | -                                                                |
 | 审计日志     | ![操作日志](https://static.iocoder.cn/images/ruoyi-vue-pro/操作日志.jpg?imageView2/2/format/webp/w/1280)   | ![登录日志](https://static.iocoder.cn/images/ruoyi-vue-pro/登录日志.jpg?imageView2/2/format/webp/w/1280) | -                                                                |
 | 短信       | ![短信渠道](https://static.iocoder.cn/images/ruoyi-vue-pro/短信渠道.jpg?imageView2/2/format/webp/w/1280)   | ![短信模板](https://static.iocoder.cn/images/ruoyi-vue-pro/短信模板.jpg?imageView2/2/format/webp/w/1280) | ![短信日志](https://static.iocoder.cn/images/ruoyi-vue-pro/短信日志.jpg?imageView2/2/format/webp/w/1280) |
-| 字典 & 敏感词      | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280)   | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | ![敏感词](https://static.iocoder.cn/images/ruoyi-vue-pro/敏感词.jpg?imageView2/2/format/webp/w/1280)                                                                |
+| 字典 & 敏感词 | ![字典类型](https://static.iocoder.cn/images/ruoyi-vue-pro/字典类型.jpg?imageView2/2/format/webp/w/1280)   | ![字典数据](https://static.iocoder.cn/images/ruoyi-vue-pro/字典数据.jpg?imageView2/2/format/webp/w/1280) | ![敏感词](https://static.iocoder.cn/images/ruoyi-vue-pro/敏感词.jpg?imageView2/2/format/webp/w/1280)                                                                |
 | 错误码 & 通知 | ![错误码管理](https://static.iocoder.cn/images/ruoyi-vue-pro/错误码管理.jpg?imageView2/2/format/webp/w/1280) | ![通知公告](https://static.iocoder.cn/images/ruoyi-vue-pro/通知公告.jpg?imageView2/2/format/webp/w/1280) | -                                                                |
 
 ### 工作流程

+ 2 - 2
http-client.env.json

@@ -5,7 +5,7 @@
     "adminTenentId": "1",
 
     "appApi": "http://127.0.0.1:48080/app-api",
-    "appToken": "test1",
+    "appToken": "test247",
     "appTenentId": "1"
   },
   "gateway": {
@@ -15,6 +15,6 @@
 
     "appApi": "http://127.0.0.1:8888/app-api",
     "appToken": "test1",
-    "appTenentId": "1"
+    "appTenantId": "1"
   }
 }

+ 19 - 9
pom.xml

@@ -12,14 +12,17 @@
         <module>yudao-framework</module>
         <!-- Server 主项目 -->
         <module>yudao-server</module>
-        <!--  各种 module 拓展 -->
+        <!-- 各种 module 拓展 -->
         <module>yudao-module-member</module>
-        <module>yudao-module-bpm</module>
         <module>yudao-module-system</module>
         <module>yudao-module-infra</module>
         <module>yudao-module-pay</module>
-        <module>yudao-module-mall</module>
-        <module>yudao-module-visualization</module>
+<!--        <module>yudao-module-bpm</module>-->
+<!--        <module>yudao-module-visualization</module>-->
+<!--        <module>yudao-module-mp</module>-->
+        <!--        <module>yudao-module-mall</module>-->
+        <!-- 示例项目 -->
+        <module>yudao-example</module>
     </modules>
 
     <name>${project.artifactId}</name>
@@ -27,16 +30,17 @@
     <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
 
     <properties>
-        <revision>1.6.3-snapshot</revision>
+        <revision>1.6.6-snapshot</revision>
         <!-- Maven 相关 -->
         <java.version>1.8</java.version>
         <maven.compiler.source>${java.version}</maven.compiler.source>
         <maven.compiler.target>${java.version}</maven.compiler.target>
         <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
-        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
+        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
         <!-- 看看咋放到 bom 里 -->
-        <lombok.version>1.18.20</lombok.version>
-        <mapstruct.version>1.4.1.Final</mapstruct.version>
+        <lombok.version>1.18.24</lombok.version>
+        <spring.boot.version>2.7.7</spring.boot.version>
+        <mapstruct.version>1.5.3.Final</mapstruct.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -62,13 +66,19 @@
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>${maven-surefire-plugin.version}</version>
                 </plugin>
-                <!-- maven-compiler-plugin 插件,解决 Lombok + MapStruct 组合 -->
+                <!-- maven-compiler-plugin 插件,解决 spring-boot-configuration-processor + Lombok + MapStruct 组合 -->
+                <!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>${maven-compiler-plugin.version}</version>
                     <configuration>
                         <annotationProcessorPaths>
+                            <path>
+                                <groupId>org.springframework.boot</groupId>
+                                <artifactId>spring-boot-configuration-processor</artifactId>
+                                <version>${spring.boot.version}</version>
+                            </path>
                             <path>
                                 <groupId>org.projectlombok</groupId>
                                 <artifactId>lombok</artifactId>

+ 7 - 4
sql/optional/visualization/jimureport.mysql5.7.create.sql → sql/mysql/optional/jimureport.mysql5.7.create.sql

@@ -418,17 +418,19 @@ CREATE TABLE `jimu_report_data_source`  (
   `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
   `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
   `connect_times` int(1) UNSIGNED NULL DEFAULT 0 COMMENT '连接失败次数',
+  `tenant_id` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '多租户标识',
+  `type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型(report:报表;drag:仪表盘)',
   PRIMARY KEY (`id`) USING BTREE,
   INDEX `idx_jmdatasource_report_id`(`report_id`) USING BTREE,
   INDEX `idx_jmdatasource_code`(`code`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 
 -- ----------------------------
 -- Records of jimu_report_data_source
 -- ----------------------------
-INSERT INTO `jimu_report_data_source` VALUES ('1324261983692902402', 'jeewx', '1324261770294071296', '', NULL, 'MYSQL', 'com.mysql.jdbc.Driver', 'jdbc:mysql://127.0.0.1:3306/jeewx-boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8', 'root', 'root', 'jeecg', '2020-11-05 16:07:15', NULL, '2020-11-05 16:07:15', 0);
-INSERT INTO `jimu_report_data_source` VALUES ('26d21fe4f27920d2f56abc8d90a8e527', 'oracle', '1308645288868712448', '', NULL, 'ORACLE', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@192.168.1.199:1521:helowin', 'jeecgbootbpm', 'jeecg196283', 'admin', '2021-01-05 19:26:24', NULL, '2021-01-05 19:26:24', 1);
-INSERT INTO `jimu_report_data_source` VALUES ('8f90daf47d15d35ca6cf420748b8b9ba', 'localhost', '1316944968992034816', '', NULL, 'MYSQL5.7', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8', 'root', 'root', 'admin', '2021-01-13 14:34:00', NULL, '2021-01-13 14:34:00', 0);
+INSERT INTO `jimu_report_data_source` VALUES ('1324261983692902402', 'jeewx', '1324261770294071296', '', NULL, 'MYSQL', 'com.mysql.jdbc.Driver', 'jdbc:mysql://127.0.0.1:3306/jeewx-boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8', 'root', 'root', 'jeecg', '2020-11-05 16:07:15', NULL, '2020-11-05 16:07:15', 0, NULL, 'report');
+INSERT INTO `jimu_report_data_source` VALUES ('26d21fe4f27920d2f56abc8d90a8e527', 'oracle', '1308645288868712448', '', NULL, 'ORACLE', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@192.168.1.199:1521:helowin', 'jeecgbootbpm', 'jeecg196283', 'admin', '2021-01-05 19:26:24', NULL, '2021-01-05 19:26:24', 1, NULL, 'report');
+INSERT INTO `jimu_report_data_source` VALUES ('8f90daf47d15d35ca6cf420748b8b9ba', 'localhost', '1316944968992034816', '', NULL, 'MYSQL5.7', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8', 'root', 'root', 'admin', '2021-01-13 14:34:00', NULL, '2021-01-13 14:34:00', 0, NULL, 'report');
 
 -- ----------------------------
 -- Table structure for jimu_report_db
@@ -1342,6 +1344,7 @@ CREATE TABLE `jimu_report_share`  (
   `last_update_time` datetime NULL DEFAULT NULL COMMENT '最后更新时间',
   `term_of_validity` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '有效期(0:永久有效,1:1天,2:7天)',
   `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否过期(0未过期,1已过期)',
+  `preview_lock_status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码锁状态',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '积木报表预览权限表' ROW_FORMAT = Dynamic;
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 118 - 0
sql/mysql/optional/mp.sql


+ 6 - 2
sql/mysql/vue3-menu.sql → sql/mysql/optional/vue3-menu.sql

@@ -1,6 +1,9 @@
 -- ----------------------------
 -- Table structure for system_menu
 -- icon 不兼容
+-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!!
+-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!!
+-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!!
 -- ----------------------------
 DROP TABLE IF EXISTS `system_menu`;
 CREATE TABLE `system_menu`  (
@@ -257,7 +260,8 @@ INSERT INTO `system_menu` VALUES (1264, '客户端查询', 'system:oauth2-client
 INSERT INTO `system_menu` VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', b'0');
 INSERT INTO `system_menu` VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', b'0');
 INSERT INTO `system_menu` VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0');
-INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'ep:histogram', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0');
-INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'ep:histogram', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0');
+INSERT INTO `system_menu` VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'ep:histogram', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0');
+INSERT INTO `system_menu` VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'ep:histogram', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0');
+INSERT INTO `system_menu` VALUES (1283, 'webSocket连接', '', 2, 14, 2, 'webSocket', 'ep:turn-off', 'infra/webSocket/index', 0, b'1', b'1', '1', '2023-01-01 11:43:04', '1', '2023-01-01 11:43:04', b'0');
 
 SET FOREIGN_KEY_CHECKS = 1;

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 822 - 135
sql/mysql/ruoyi-vue-pro.sql


+ 0 - 287
sql/optional/mall/mall.sql

@@ -1,287 +0,0 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server         : 127.0.0.1
- Source Server Type    : MySQL
- Source Server Version : 80026
- Source Host           : localhost:3306
- Source Schema         : ruoyi-vue-pro
-
- Target Server Type    : MySQL
- Target Server Version : 80026
- File Encoding         : 65001
-
- Date: 05/02/2022 00:50:30
-*/
-SET
-FOREIGN_KEY_CHECKS = 0;
-SET NAMES utf8mb4;
-
--- ----------------------------
--- Table structure for product_category
--- ----------------------------
-DROP TABLE IF EXISTS `product_category`;
-CREATE TABLE `product_category`
-(
-    `id`          bigint       NOT NULL AUTO_INCREMENT COMMENT '分类编号',
-    `parent_id`   bigint       NOT NULL COMMENT '父分类编号',
-    `name`        varchar(255) NOT NULL COMMENT '分类名称',
-    `icon`        varchar(100) NOT NULL DEFAULT '#' COMMENT '分类图标',
-    `banner_url`  varchar(255) NOT NULL COMMENT '分类图片',
-    `sort`        int                   DEFAULT '0' COMMENT '分类排序',
-    `description` varchar(1024)         DEFAULT NULL COMMENT '分类描述',
-    `status`      tinyint      NOT NULL COMMENT '开启状态',
-    `creator`     varchar(64)           DEFAULT '' COMMENT '创建者',
-    `create_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-    `updater`     varchar(64)           DEFAULT '' COMMENT '更新者',
-    `update_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-    `deleted`     bit(1)       NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    `tenant_id`   bigint       NOT NULL DEFAULT '0' COMMENT '租户编号',
-    PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB COMMENT='商品分类';
-
--- ----------------------------
--- Table structure for product_brand
--- ----------------------------
-DROP TABLE IF EXISTS `product_brand`;
-CREATE TABLE `product_brand`
-(
-    `id`          bigint       NOT NULL AUTO_INCREMENT COMMENT '品牌编号',
-    `category_id` bigint       NOT NULL COMMENT '分类编号',
-    `name`        varchar(255) NOT NULL COMMENT '品牌名称',
-    `banner_url`  varchar(255) NOT NULL COMMENT '品牌图片',
-    `sort`        int                   DEFAULT '0' COMMENT '品牌排序',
-    `description` varchar(1024)         DEFAULT NULL COMMENT '品牌描述',
-    `status`      tinyint      NOT NULL COMMENT '状态',
-    `creator`     varchar(64)           DEFAULT '' COMMENT '创建者',
-    `create_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-    `updater`     varchar(64)           DEFAULT '' COMMENT '更新者',
-    `update_time` datetime     NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-    `deleted`     bit(1)       NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    `tenant_id`   bigint       NOT NULL DEFAULT '0' COMMENT '租户编号',
-    PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB COMMENT='品牌';
-
--- TODO 父级菜单的 id 处理: 2000 、 2001
-INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES (2000, '商城', '', 1, 1, 0, '/mall', 'merchant', NULL, 0);
-INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES (2001, '商品', '', 1, 1, 2000, 'product', 'dict', NULL, 0);
--- 商品分类 菜单 SQL
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类管理', '', 2, 0, 2001, 'category', '', 'mall/product/category/index', 0);
--- 按钮父菜单ID
-SELECT @parentId := LAST_INSERT_ID();
--- 按钮 SQL
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类查询', 'product:category:query', 3, 1, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类创建', 'product:category:create', 3, 2, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类更新', 'product:category:update', 3, 3, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类删除', 'product:category:delete', 3, 4, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('分类导出', 'product:category:export', 3, 5, @parentId, '', '', '', 0);
--- 品牌管理 菜单 SQL
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌管理', '', 2, 1, 2001, 'brand', '', 'mall/product/brand/index', 0);
--- 按钮父菜单ID
-SELECT @parentId := LAST_INSERT_ID();
--- 按钮 SQL
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌查询', 'product:brand:query', 3, 1, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌创建', 'product:brand:create', 3, 2, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌更新', 'product:brand:update', 3, 3, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌删除', 'product:brand:delete', 3, 4, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('品牌导出', 'product:brand:export', 3, 5, @parentId, '', '', '', 0);
-
-
--- ----------------------------
--- Table structure for market_activity
--- ----------------------------
-DROP TABLE IF EXISTS `market_activity`;
-CREATE TABLE `market_activity`
-(
-    `id`                    bigint      NOT NULL AUTO_INCREMENT COMMENT '活动编号',
-    `title`                 varchar(50) NOT NULL DEFAULT '' COMMENT '活动标题',
-    `activity_type`         tinyint(4) NOT NULL COMMENT '活动类型',
-    `status`                tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态',
-    `start_time`            datetime    NOT NULL COMMENT '开始时间',
-    `end_time`              datetime    NOT NULL COMMENT '结束时间',
-    `invalid_time`          datetime             DEFAULT NULL COMMENT '失效时间',
-    `delete_time`           datetime             DEFAULT NULL COMMENT '删除时间',
-    `time_limited_discount` varchar(2000)        DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储',
-    `full_privilege`        varchar(2000)        DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储',
-    `creator`               varchar(64)          DEFAULT '' COMMENT '创建者',
-    `create_time`           datetime    NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-    `updater`               varchar(64)          DEFAULT '' COMMENT '更新者',
-    `update_time`           datetime    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-    `deleted`               bit(1)      NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    `tenant_id`             bigint      NOT NULL DEFAULT '0' COMMENT '租户编号',
-    PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='促销活动';
-
-
--- 规格菜单 SQL
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格管理', '', 2, 3, 2001, 'property', '', 'mall/product/property/index', 0);
-
--- 按钮父菜单ID
-SELECT @parentId := LAST_INSERT_ID();
-
--- 按钮 SQL
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格查询', 'product:property:query', 3, 1, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格创建', 'product:property:create', 3, 2, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格更新', 'product:property:update', 3, 3, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格删除', 'product:property:delete', 3, 4, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('规格导出', 'product:property:export', 3, 5, @parentId, '', '', '', 0);
-
-
--- 商品菜单 SQL
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品管理', '', 2, 2, 2001, 'spu', '', 'mall/product/spu/index', 0);
-
--- 按钮父菜单ID
-SELECT @parentId := LAST_INSERT_ID();
-
--- 按钮 SQL
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品查询', 'product:spu:query', 3, 1, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品创建', 'product:spu:create', 3, 2, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品更新', 'product:spu:update', 3, 3, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品删除', 'product:spu:delete', 3, 4, @parentId, '', '', '', 0);
-INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
-VALUES ('商品导出', 'product:spu:export', 3, 5, @parentId, '', '', '', 0);
-
-
--- 规格名称表
-drop table if exists product_property;
-create table product_property
-(
-    id          bigint NOT NULL AUTO_INCREMENT comment '主键',
-    name        varchar(64) comment '规格名称',
-    status      tinyint comment '状态: 0 开启 ,1 禁用',
-    create_time datetime        default current_timestamp comment '创建时间',
-    update_time datetime        default current_timestamp on update current_timestamp comment '更新时间',
-    creator     varchar(64) comment '创建人',
-    updater     varchar(64) comment '更新人',
-    tenant_id   bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
-    deleted   bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    primary key (id),
-    key         idx_name ( name (32)) comment '规格名称索引'
-) comment '规格名称' character set utf8mb4
-                 collate utf8mb4_general_ci;
-
--- 规格值表
-drop table if exists product_property_value;
-create table product_property_value
-(
-    id          bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
-    property_id bigint comment '规格键id',
-    name        varchar(128) comment '规格值名字',
-    status      tinyint comment '状态: 1 开启 ,2 禁用',
-    create_time datetime        default current_timestamp comment '创建时间',
-    update_time datetime        default current_timestamp on update current_timestamp comment '更新时间',
-    creator     varchar(64) comment '创建人',
-    updater     varchar(64) comment '更新人',
-    tenant_id   bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
-    deleted   bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    primary key (id)
-) comment '规格值' character set utf8mb4
-                collate utf8mb4_general_ci;
-
--- spu
-drop table if exists product_spu;
-create table product_spu
-(
-    id          bigint        NOT NULL AUTO_INCREMENT COMMENT '主键',
-    name        varchar(128) comment '商品名称',
-    sell_point  varchar(128)  not null comment '卖点',
-    description text          not null comment '描述',
-    category_id bigint        not null comment '分类id',
-    pic_urls    varchar(1024) not null default '' comment '商品主图地址\n     *\n     * 数组,以逗号分隔\n 最多上传15张',
-    sort        int           not null default 0 comment '排序字段',
-    like_count  int comment '点赞初始人数',
-    price       int comment '价格 单位使用:分',
-    quantity    int comment '库存数量',
-    status      bit(1) comment '上下架状态: 0 上架(开启) 1 下架(禁用)',
-    create_time datetime               default current_timestamp comment '创建时间',
-    update_time datetime               default current_timestamp on update current_timestamp comment '更新时间',
-    creator     varchar(64) comment '创建人',
-    updater     varchar(64) comment '更新人',
-    tenant_id   bigint        NOT NULL DEFAULT '0' COMMENT '租户编号',
-    deleted   bit(1)        NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    primary key (id)
-) comment '商品spu' character set utf8mb4
-                  collate utf8mb4_general_ci;
-
-
--- sku
-drop table if exists product_sku;
-create table product_sku
-(
-    id             bigint       NOT NULL AUTO_INCREMENT COMMENT '主键',
-    spu_id         bigint       not null comment 'spu编号',
-    properties     varchar(64)  not null comment '规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]',
-    price          int          not null DEFAULT -1 comment '销售价格,单位:分',
-    original_price int          not null DEFAULT -1 comment '原价, 单位: 分',
-    cost_price     int          not null DEFAULT -1 comment '成本价,单位: 分',
-    bar_code       varchar(64)  not null comment '条形码',
-    pic_url        VARCHAR(128) not null comment '图片地址',
-    status         tinyint comment '状态: 0-正常 1-禁用',
-    create_time    datetime              default current_timestamp comment '创建时间',
-    update_time    datetime              default current_timestamp on update current_timestamp comment '更新时间',
-    creator        varchar(64) comment '创建人',
-    updater        varchar(64) comment '更新人',
-    tenant_id      bigint       NOT NULL DEFAULT '0' COMMENT '租户编号',
-    deleted      bit(1)       NOT NULL DEFAULT b'0' COMMENT '是否删除',
-    primary key (id)
-) comment '商品sku' character set utf8mb4
-                  collate utf8mb4_general_ci;
-
-
----Market-Banner管理SQL
-drop table if exists market_banner;
-CREATE TABLE `market_banner` (
-  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Banner编号',
-  `title` varchar(64) NOT NULL DEFAULT '' COMMENT 'Banner标题',
-  `pic_url` varchar(255) NOT NULL COMMENT '图片URL',
-  `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态',
-  `url` varchar(255) NOT NULL COMMENT '跳转地址',
-  `creator` varchar(64) DEFAULT '' COMMENT '创建者',
-  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-  `updater` varchar(64) DEFAULT '' COMMENT '更新者',
-  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
-  `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
-  `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号',
-  `sort` tinyint(4) DEFAULT NULL COMMENT '排序',
-  `memo` varchar(255) DEFAULT NULL COMMENT '描述',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='Banner管理';
--- 菜单 SQL
-INSERT INTO `system_menu`(`id`,`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES (2002, 'Banner管理', '', 2, 1, 2000, 'brand', '', 'mall/market/banner/index', 0);
--- 按钮父菜单ID
-SELECT @parentId := LAST_INSERT_ID();
--- 按钮 SQL
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('Banner查询', 'market:banner:query', 3, 1, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('Banner创建', 'market:banner:create', 3, 2, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('Banner更新', 'market:banner:update', 3, 3, @parentId, '', '', '', 0);
-INSERT INTO `system_menu`(`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`)
-VALUES ('Banner删除', 'market:banner:delete', 3, 4, @parentId, '', '', '', 0);

+ 214 - 186
sql/oracle/ruoyi-vue-pro.sql

@@ -38,8 +38,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -96,8 +96,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -159,8 +159,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -224,8 +224,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -284,8 +284,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -342,8 +342,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -400,8 +400,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -463,8 +463,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -543,8 +543,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -645,8 +645,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -718,8 +718,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -780,8 +780,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -839,8 +839,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -892,8 +892,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -945,8 +945,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -999,8 +999,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1053,8 +1053,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1113,8 +1113,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1169,8 +1169,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1226,8 +1226,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1284,8 +1284,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1341,8 +1341,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1398,8 +1398,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1451,8 +1451,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1510,8 +1510,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1589,8 +1589,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1665,8 +1665,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1742,8 +1742,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1807,8 +1807,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1840,8 +1840,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1875,8 +1875,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1919,8 +1919,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1959,8 +1959,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -1992,8 +1992,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2026,8 +2026,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2060,8 +2060,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2097,8 +2097,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2141,8 +2141,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2187,8 +2187,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2232,8 +2232,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2303,8 +2303,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2454,7 +2454,6 @@ INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "ST
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('62', '0', '未处理', '0', 'infra_api_error_log_process_status', '0', 'primary', NULL, NULL, NULL, TO_DATE('2021-02-26 07:07:19', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 20:14:17', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('63', '1', '已处理', '1', 'infra_api_error_log_process_status', '0', 'success', NULL, NULL, NULL, TO_DATE('2021-02-26 07:07:26', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 20:14:08', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('64', '2', '已忽略', '2', 'infra_api_error_log_process_status', '0', 'danger', NULL, NULL, NULL, TO_DATE('2021-02-26 07:07:34', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 20:14:14', 'SYYYY-MM-DD HH24:MI:SS'), '0');
-INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('65', '1', '云片', 'YUN_PIAN', 'system_sms_channel_code', '0', 'success', NULL, NULL, '1', TO_DATE('2021-04-05 01:05:14', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 10:09:55', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('66', '2', '阿里云', 'ALIYUN', 'system_sms_channel_code', '0', 'primary', NULL, NULL, '1', TO_DATE('2021-04-05 01:05:26', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 10:09:52', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('67', '1', '验证码', '1', 'system_sms_template_type', '0', 'warning', NULL, NULL, '1', TO_DATE('2021-04-05 21:50:57', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 12:48:30', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_DATA" ("ID", "SORT", "LABEL", "VALUE", "DICT_TYPE", "STATUS", "COLOR_TYPE", "CSS_CLASS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('68', '2', '通知', '2', 'system_sms_template_type', '0', 'primary', NULL, NULL, '1', TO_DATE('2021-04-05 21:51:08', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 12:48:27', 'SYYYY-MM-DD HH24:MI:SS'), '0');
@@ -2475,25 +2474,26 @@ COMMIT;
 -- Table structure for SYSTEM_DICT_TYPE
 -- ----------------------------
 DROP TABLE "SYSTEM_DICT_TYPE";
-CREATE TABLE "SYSTEM_DICT_TYPE" (
-  "ID" NUMBER(20,0) NOT NULL,
-  "NAME" NVARCHAR2(100),
-  "TYPE" NVARCHAR2(100),
-  "STATUS" NUMBER(4,0) NOT NULL,
-  "REMARK" NVARCHAR2(500),
-  "CREATOR" NVARCHAR2(64),
-  "CREATE_TIME" DATE NOT NULL,
-  "UPDATER" NVARCHAR2(64),
-  "UPDATE_TIME" DATE NOT NULL,
-  "DELETED" NUMBER(1,0) DEFAULT 0 NOT NULL
+CREATE TABLE "SYSTEM_DICT_TYPE"(
+                                   "ID"           NUMBER(20,0) NOT NULL,
+                                   "NAME"         NVARCHAR2(100),
+                                   "TYPE"         NVARCHAR2(100),
+                                   "STATUS"       NUMBER(4,0) NOT NULL,
+                                   "REMARK"       NVARCHAR2(500),
+                                   "CREATOR"      NVARCHAR2(64),
+                                   "CREATE_TIME"  DATE NOT NULL,
+                                   "UPDATER"      NVARCHAR2(64),
+                                   "UPDATE_TIME"  DATE NOT NULL,
+                                   "DELETED_TIME" DATE,
+                                   "DELETED"      NUMBER(1,0) DEFAULT 0 NOT NULL
 )
 LOGGING
 NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2504,25 +2504,54 @@ PARALLEL 1
 NOCACHE
 DISABLE ROW MOVEMENT
 ;
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."ID" IS '字典主键';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."NAME" IS '字典名称';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."TYPE" IS '字典类型';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."STATUS" IS '状态(0正常 1停用)';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."REMARK" IS '备注';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."CREATOR" IS '创建者';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."CREATE_TIME" IS '创建时间';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."UPDATER" IS '更新者';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."UPDATE_TIME" IS '更新时间';
-COMMENT ON COLUMN "SYSTEM_DICT_TYPE"."DELETED" IS '是否删除';
-COMMENT ON TABLE "SYSTEM_DICT_TYPE" IS '字典类型表';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."ID" IS '字典主键';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."NAME" IS '字典名称';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."TYPE" IS '字典类型';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."STATUS" IS '状态(0正常 1停用)';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."REMARK" IS '备注';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."CREATOR" IS '创建者';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."CREATE_TIME" IS '创建时间';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."UPDATER" IS '更新者';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."UPDATE_TIME" IS '更新时间';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."DELETED_TIME" IS '删除时间';
+COMMENT
+ON COLUMN "SYSTEM_DICT_TYPE"."DELETED" IS '是否删除';
+COMMENT
+ON TABLE "SYSTEM_DICT_TYPE" IS '字典类型表';
 
 -- ----------------------------
 -- Records of SYSTEM_DICT_TYPE
 -- ----------------------------
-INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', '用户性别', 'system_user_sex', '0', NULL, 'admin', TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-05-01 12:55:56', 'SYYYY-MM-DD HH24:MI:SS'), '0');
-INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('6', '参数类型', 'infra_config_type', '0', NULL, 'admin', TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), NULL, TO_DATE('2022-02-01 16:36:54', 'SYYYY-MM-DD HH24:MI:SS'), '0');
-INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('7', '通知类型', 'system_notice_type', '0', NULL, 'admin', TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), NULL, TO_DATE('2022-02-01 16:35:26', 'SYYYY-MM-DD HH24:MI:SS'), '0');
-INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('9', '操作类型', 'system_operate_type', '0', NULL, 'admin', TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-16 09:32:21', 'SYYYY-MM-DD HH24:MI:SS'), '0');
+INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER",
+                                "UPDATE_TIME", "DELETED")
+VALUES ('1', '用户性别', 'system_user_sex', '0', NULL, 'admin',
+        TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), '1',
+        TO_DATE('2022-05-01 12:55:56', 'SYYYY-MM-DD HH24:MI:SS'), '0');
+INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER",
+                                "UPDATE_TIME", "DELETED")
+VALUES ('6', '参数类型', 'infra_config_type', '0', NULL, 'admin',
+        TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), NULL,
+        TO_DATE('2022-02-01 16:36:54', 'SYYYY-MM-DD HH24:MI:SS'), '0');
+INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER",
+                                "UPDATE_TIME", "DELETED")
+VALUES ('7', '通知类型', 'system_notice_type', '0', NULL, 'admin',
+        TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), NULL,
+        TO_DATE('2022-02-01 16:35:26', 'SYYYY-MM-DD HH24:MI:SS'), '0');
+INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER",
+                                "UPDATE_TIME", "DELETED")
+VALUES ('9', '操作类型', 'system_operate_type', '0', NULL, 'admin',
+        TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), '1',
+        TO_DATE('2022-02-16 09:32:21', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('10', '系统状态', 'common_status', '0', NULL, 'admin', TO_DATE('2021-01-05 17:03:48', 'SYYYY-MM-DD HH24:MI:SS'), NULL, TO_DATE('2022-02-01 16:21:28', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('11', 'Boolean 是否类型', 'infra_boolean_string', '0', 'boolean 转是否', NULL, TO_DATE('2021-01-19 03:20:08', 'SYYYY-MM-DD HH24:MI:SS'), NULL, TO_DATE('2022-02-01 16:37:10', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_DICT_TYPE" ("ID", "NAME", "TYPE", "STATUS", "REMARK", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('104', '登陆结果', 'system_login_result', '0', '登陆结果', NULL, TO_DATE('2021-01-18 06:17:11', 'SYYYY-MM-DD HH24:MI:SS'), NULL, TO_DATE('2022-02-01 16:36:00', 'SYYYY-MM-DD HH24:MI:SS'), '0');
@@ -2583,8 +2612,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2642,8 +2671,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2706,8 +2735,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -2995,8 +3024,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3051,8 +3080,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3109,8 +3138,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3176,8 +3205,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3245,8 +3274,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3307,8 +3336,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3377,8 +3406,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3446,8 +3475,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3508,8 +3537,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3569,8 +3598,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3759,8 +3788,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3815,8 +3844,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3845,7 +3874,6 @@ COMMENT ON TABLE "SYSTEM_SMS_CHANNEL" IS '短信渠道';
 -- ----------------------------
 -- Records of SYSTEM_SMS_CHANNEL
 -- ----------------------------
-INSERT INTO "SYSTEM_SMS_CHANNEL" ("ID", "SIGNATURE", "CODE", "STATUS", "REMARK", "API_KEY", "API_SECRET", "CALLBACK_URL", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('1', '芋道', 'YUN_PIAN', '0', '呵呵呵哒', '1555a14277cb8a608cf45a9e6a80d510', NULL, 'http://vdwapu.natappfree.cc/admin-api/system/sms/callback/yunpian', NULL, TO_DATE('2021-03-31 06:12:20', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2022-02-23 16:48:44', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_SMS_CHANNEL" ("ID", "SIGNATURE", "CODE", "STATUS", "REMARK", "API_KEY", "API_SECRET", "CALLBACK_URL", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('2', 'Ballcat', 'ALIYUN', '0', '啦啦啦', 'LTAI5tCnKso2uG3kJ5gRav88', 'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, NULL, TO_DATE('2021-03-31 11:53:10', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2021-04-14 00:08:37', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 INSERT INTO "SYSTEM_SMS_CHANNEL" ("ID", "SIGNATURE", "CODE", "STATUS", "REMARK", "API_KEY", "API_SECRET", "CALLBACK_URL", "CREATOR", "CREATE_TIME", "UPDATER", "UPDATE_TIME", "DELETED") VALUES ('4', '测试渠道', 'DEBUG_DING_TALK', '0', '123', '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', TO_DATE('2021-04-13 00:23:14', 'SYYYY-MM-DD HH24:MI:SS'), '1', TO_DATE('2021-04-14 00:07:10', 'SYYYY-MM-DD HH24:MI:SS'), '0');
 COMMIT;
@@ -3877,8 +3905,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -3953,8 +3981,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4029,8 +4057,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4102,8 +4130,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4165,8 +4193,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4224,8 +4252,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4286,8 +4314,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4360,8 +4388,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -4412,8 +4440,8 @@ NOCOMPRESS
 PCTFREE 10
 INITRANS 1
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5401,8 +5429,8 @@ CREATE INDEX "IDX_QRTZ_FT_INST_JOB_REQ_RCVRY"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5418,8 +5446,8 @@ CREATE INDEX "IDX_QRTZ_FT_JG"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5433,8 +5461,8 @@ CREATE INDEX "IDX_QRTZ_FT_J_G"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5449,8 +5477,8 @@ CREATE INDEX "IDX_QRTZ_FT_TG"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5485,8 +5513,8 @@ CREATE INDEX "IDX_QRTZ_J_GRP"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5500,8 +5528,8 @@ CREATE INDEX "IDX_QRTZ_J_REQ_RECOVERY"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5625,8 +5653,8 @@ CREATE INDEX "IDX_QRTZ_T_C"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5640,8 +5668,8 @@ CREATE INDEX "IDX_QRTZ_T_J"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5657,8 +5685,8 @@ CREATE INDEX "IDX_QRTZ_T_JG"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5672,8 +5700,8 @@ CREATE INDEX "IDX_QRTZ_T_NEXT_FIRE_TIME"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5687,8 +5715,8 @@ CREATE INDEX "IDX_QRTZ_T_NFT_ST"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5704,8 +5732,8 @@ CREATE INDEX "IDX_QRTZ_T_NFT_ST_MISFIRE"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1
@@ -5719,8 +5747,8 @@ CREATE INDEX "IDX_QRTZ_T_STATE"
 PCTFREE 10
 INITRANS 2
 STORAGE (
-  INITIAL 65536 
-  NEXT 1048576 
+  INITIAL 65536
+  NEXT 1048576
   MINEXTENTS 1
   MAXEXTENTS 2147483645
   FREELISTS 1

+ 101 - 83
sql/postgresql/ruoyi-vue-pro.sql

@@ -20,7 +20,7 @@
 -- Sequence structure for bpm_form_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_form_seq";
-CREATE SEQUENCE "bpm_form_seq" 
+CREATE SEQUENCE "bpm_form_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -29,7 +29,7 @@ CACHE 1;
 -- Sequence structure for bpm_oa_leave_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_oa_leave_seq";
-CREATE SEQUENCE "bpm_oa_leave_seq" 
+CREATE SEQUENCE "bpm_oa_leave_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -38,7 +38,7 @@ CACHE 1;
 -- Sequence structure for bpm_process_definition_ext_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_process_definition_ext_seq";
-CREATE SEQUENCE "bpm_process_definition_ext_seq" 
+CREATE SEQUENCE "bpm_process_definition_ext_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -47,7 +47,7 @@ CACHE 1;
 -- Sequence structure for bpm_process_instance_ext_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_process_instance_ext_seq";
-CREATE SEQUENCE "bpm_process_instance_ext_seq" 
+CREATE SEQUENCE "bpm_process_instance_ext_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -56,7 +56,7 @@ CACHE 1;
 -- Sequence structure for bpm_task_assign_rule_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_task_assign_rule_seq";
-CREATE SEQUENCE "bpm_task_assign_rule_seq" 
+CREATE SEQUENCE "bpm_task_assign_rule_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -65,7 +65,7 @@ CACHE 1;
 -- Sequence structure for bpm_task_ext_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_task_ext_seq";
-CREATE SEQUENCE "bpm_task_ext_seq" 
+CREATE SEQUENCE "bpm_task_ext_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -74,7 +74,7 @@ CACHE 1;
 -- Sequence structure for bpm_user_group_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "bpm_user_group_seq";
-CREATE SEQUENCE "bpm_user_group_seq" 
+CREATE SEQUENCE "bpm_user_group_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -83,7 +83,7 @@ CACHE 1;
 -- Sequence structure for infra_api_access_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_api_access_log_seq";
-CREATE SEQUENCE "infra_api_access_log_seq" 
+CREATE SEQUENCE "infra_api_access_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -92,7 +92,7 @@ CACHE 1;
 -- Sequence structure for infra_api_error_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_api_error_log_seq";
-CREATE SEQUENCE "infra_api_error_log_seq" 
+CREATE SEQUENCE "infra_api_error_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -101,7 +101,7 @@ CACHE 1;
 -- Sequence structure for infra_codegen_column_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_codegen_column_seq";
-CREATE SEQUENCE "infra_codegen_column_seq" 
+CREATE SEQUENCE "infra_codegen_column_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -110,7 +110,7 @@ CACHE 1;
 -- Sequence structure for infra_codegen_table_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_codegen_table_seq";
-CREATE SEQUENCE "infra_codegen_table_seq" 
+CREATE SEQUENCE "infra_codegen_table_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -119,7 +119,7 @@ CACHE 1;
 -- Sequence structure for infra_config_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_config_seq";
-CREATE SEQUENCE "infra_config_seq" 
+CREATE SEQUENCE "infra_config_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -128,7 +128,7 @@ CACHE 1;
 -- Sequence structure for infra_data_source_config_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_data_source_config_seq";
-CREATE SEQUENCE "infra_data_source_config_seq" 
+CREATE SEQUENCE "infra_data_source_config_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -137,7 +137,7 @@ CACHE 1;
 -- Sequence structure for infra_file_config_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_file_config_seq";
-CREATE SEQUENCE "infra_file_config_seq" 
+CREATE SEQUENCE "infra_file_config_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -146,7 +146,7 @@ CACHE 1;
 -- Sequence structure for infra_file_content_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_file_content_seq";
-CREATE SEQUENCE "infra_file_content_seq" 
+CREATE SEQUENCE "infra_file_content_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -155,7 +155,7 @@ CACHE 1;
 -- Sequence structure for infra_file_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_file_seq";
-CREATE SEQUENCE "infra_file_seq" 
+CREATE SEQUENCE "infra_file_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -164,7 +164,7 @@ CACHE 1;
 -- Sequence structure for infra_job_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_job_log_seq";
-CREATE SEQUENCE "infra_job_log_seq" 
+CREATE SEQUENCE "infra_job_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -173,7 +173,7 @@ CACHE 1;
 -- Sequence structure for infra_job_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_job_seq";
-CREATE SEQUENCE "infra_job_seq" 
+CREATE SEQUENCE "infra_job_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -182,7 +182,7 @@ CACHE 1;
 -- Sequence structure for infra_test_demo_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "infra_test_demo_seq";
-CREATE SEQUENCE "infra_test_demo_seq" 
+CREATE SEQUENCE "infra_test_demo_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -191,7 +191,7 @@ CACHE 1;
 -- Sequence structure for member_user_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "member_user_seq";
-CREATE SEQUENCE "member_user_seq" 
+CREATE SEQUENCE "member_user_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -200,7 +200,7 @@ CACHE 1;
 -- Sequence structure for pay_app_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_app_seq";
-CREATE SEQUENCE "pay_app_seq" 
+CREATE SEQUENCE "pay_app_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -209,7 +209,7 @@ CACHE 1;
 -- Sequence structure for pay_channel_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_channel_seq";
-CREATE SEQUENCE "pay_channel_seq" 
+CREATE SEQUENCE "pay_channel_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -218,7 +218,7 @@ CACHE 1;
 -- Sequence structure for pay_merchant_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_merchant_seq";
-CREATE SEQUENCE "pay_merchant_seq" 
+CREATE SEQUENCE "pay_merchant_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -227,7 +227,7 @@ CACHE 1;
 -- Sequence structure for pay_notify_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_notify_log_seq";
-CREATE SEQUENCE "pay_notify_log_seq" 
+CREATE SEQUENCE "pay_notify_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -236,7 +236,7 @@ CACHE 1;
 -- Sequence structure for pay_notify_task_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_notify_task_seq";
-CREATE SEQUENCE "pay_notify_task_seq" 
+CREATE SEQUENCE "pay_notify_task_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -245,7 +245,7 @@ CACHE 1;
 -- Sequence structure for pay_order_extension_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_order_extension_seq";
-CREATE SEQUENCE "pay_order_extension_seq" 
+CREATE SEQUENCE "pay_order_extension_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -254,7 +254,7 @@ CACHE 1;
 -- Sequence structure for pay_order_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_order_seq";
-CREATE SEQUENCE "pay_order_seq" 
+CREATE SEQUENCE "pay_order_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -263,7 +263,7 @@ CACHE 1;
 -- Sequence structure for pay_refund_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "pay_refund_seq";
-CREATE SEQUENCE "pay_refund_seq" 
+CREATE SEQUENCE "pay_refund_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -272,7 +272,7 @@ CACHE 1;
 -- Sequence structure for system_dept_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_dept_seq";
-CREATE SEQUENCE "system_dept_seq" 
+CREATE SEQUENCE "system_dept_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -281,7 +281,7 @@ CACHE 1;
 -- Sequence structure for system_dict_data_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_dict_data_seq";
-CREATE SEQUENCE "system_dict_data_seq" 
+CREATE SEQUENCE "system_dict_data_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -290,7 +290,7 @@ CACHE 1;
 -- Sequence structure for system_dict_type_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_dict_type_seq";
-CREATE SEQUENCE "system_dict_type_seq" 
+CREATE SEQUENCE "system_dict_type_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -299,7 +299,7 @@ CACHE 1;
 -- Sequence structure for system_error_code_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_error_code_seq";
-CREATE SEQUENCE "system_error_code_seq" 
+CREATE SEQUENCE "system_error_code_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -308,7 +308,7 @@ CACHE 1;
 -- Sequence structure for system_login_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_login_log_seq";
-CREATE SEQUENCE "system_login_log_seq" 
+CREATE SEQUENCE "system_login_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -317,7 +317,7 @@ CACHE 1;
 -- Sequence structure for system_menu_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_menu_seq";
-CREATE SEQUENCE "system_menu_seq" 
+CREATE SEQUENCE "system_menu_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -326,7 +326,7 @@ CACHE 1;
 -- Sequence structure for system_notice_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_notice_seq";
-CREATE SEQUENCE "system_notice_seq" 
+CREATE SEQUENCE "system_notice_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -335,7 +335,7 @@ CACHE 1;
 -- Sequence structure for system_oauth2_access_token_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_oauth2_access_token_seq";
-CREATE SEQUENCE "system_oauth2_access_token_seq" 
+CREATE SEQUENCE "system_oauth2_access_token_seq"
 INCREMENT 1
 MINVALUE  1
 MAXVALUE 9223372036854775807
@@ -346,7 +346,7 @@ CACHE 1;
 -- Sequence structure for system_oauth2_approve_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_oauth2_approve_seq";
-CREATE SEQUENCE "system_oauth2_approve_seq" 
+CREATE SEQUENCE "system_oauth2_approve_seq"
 INCREMENT 1
 MINVALUE  1
 MAXVALUE 9223372036854775807
@@ -357,7 +357,7 @@ CACHE 1;
 -- Sequence structure for system_oauth2_client_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_oauth2_client_seq";
-CREATE SEQUENCE "system_oauth2_client_seq" 
+CREATE SEQUENCE "system_oauth2_client_seq"
 INCREMENT 1
 MINVALUE  1
 MAXVALUE 9223372036854775807
@@ -368,7 +368,7 @@ CACHE 1;
 -- Sequence structure for system_oauth2_code_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_oauth2_code_seq";
-CREATE SEQUENCE "system_oauth2_code_seq" 
+CREATE SEQUENCE "system_oauth2_code_seq"
 INCREMENT 1
 MINVALUE  1
 MAXVALUE 9223372036854775807
@@ -379,7 +379,7 @@ CACHE 1;
 -- Sequence structure for system_oauth2_refresh_token_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_oauth2_refresh_token_seq";
-CREATE SEQUENCE "system_oauth2_refresh_token_seq" 
+CREATE SEQUENCE "system_oauth2_refresh_token_seq"
 INCREMENT 1
 MINVALUE  1
 MAXVALUE 9223372036854775807
@@ -390,7 +390,7 @@ CACHE 1;
 -- Sequence structure for system_operate_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_operate_log_seq";
-CREATE SEQUENCE "system_operate_log_seq" 
+CREATE SEQUENCE "system_operate_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -399,7 +399,7 @@ CACHE 1;
 -- Sequence structure for system_post_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_post_seq";
-CREATE SEQUENCE "system_post_seq" 
+CREATE SEQUENCE "system_post_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -408,7 +408,7 @@ CACHE 1;
 -- Sequence structure for system_role_menu_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_role_menu_seq";
-CREATE SEQUENCE "system_role_menu_seq" 
+CREATE SEQUENCE "system_role_menu_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -417,7 +417,7 @@ CACHE 1;
 -- Sequence structure for system_role_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_role_seq";
-CREATE SEQUENCE "system_role_seq" 
+CREATE SEQUENCE "system_role_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -426,7 +426,7 @@ CACHE 1;
 -- Sequence structure for system_sensitive_word_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_sensitive_word_seq";
-CREATE SEQUENCE "system_sensitive_word_seq" 
+CREATE SEQUENCE "system_sensitive_word_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -435,7 +435,7 @@ CACHE 1;
 -- Sequence structure for system_sms_channel_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_sms_channel_seq";
-CREATE SEQUENCE "system_sms_channel_seq" 
+CREATE SEQUENCE "system_sms_channel_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -444,7 +444,7 @@ CACHE 1;
 -- Sequence structure for system_sms_code_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_sms_code_seq";
-CREATE SEQUENCE "system_sms_code_seq" 
+CREATE SEQUENCE "system_sms_code_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -453,7 +453,7 @@ CACHE 1;
 -- Sequence structure for system_sms_log_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_sms_log_seq";
-CREATE SEQUENCE "system_sms_log_seq" 
+CREATE SEQUENCE "system_sms_log_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -462,7 +462,7 @@ CACHE 1;
 -- Sequence structure for system_sms_template_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_sms_template_seq";
-CREATE SEQUENCE "system_sms_template_seq" 
+CREATE SEQUENCE "system_sms_template_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -471,7 +471,7 @@ CACHE 1;
 -- Sequence structure for system_social_user_bind_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_social_user_bind_seq";
-CREATE SEQUENCE "system_social_user_bind_seq" 
+CREATE SEQUENCE "system_social_user_bind_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -480,7 +480,7 @@ CACHE 1;
 -- Sequence structure for system_social_user_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_social_user_seq";
-CREATE SEQUENCE "system_social_user_seq" 
+CREATE SEQUENCE "system_social_user_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -489,7 +489,7 @@ CACHE 1;
 -- Sequence structure for system_tenant_package_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_tenant_package_seq";
-CREATE SEQUENCE "system_tenant_package_seq" 
+CREATE SEQUENCE "system_tenant_package_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -498,7 +498,7 @@ CACHE 1;
 -- Sequence structure for system_tenant_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_tenant_seq";
-CREATE SEQUENCE "system_tenant_seq" 
+CREATE SEQUENCE "system_tenant_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -507,7 +507,7 @@ CACHE 1;
 -- Sequence structure for system_user_post_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_user_post_seq";
-CREATE SEQUENCE "system_user_post_seq" 
+CREATE SEQUENCE "system_user_post_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -516,7 +516,7 @@ CACHE 1;
 -- Sequence structure for system_user_role_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_user_role_seq";
-CREATE SEQUENCE "system_user_role_seq" 
+CREATE SEQUENCE "system_user_role_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -525,7 +525,7 @@ CACHE 1;
 -- Sequence structure for system_user_seq
 -- ----------------------------
 DROP SEQUENCE IF EXISTS "system_user_seq";
-CREATE SEQUENCE "system_user_seq" 
+CREATE SEQUENCE "system_user_seq"
 INCREMENT 1
 MAXVALUE 9223372036854775807
 CACHE 1;
@@ -2267,7 +2267,6 @@ INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "st
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (62, 0, '未处理', '0', 'infra_api_error_log_process_status', 0, 'primary', '', NULL, '', '2021-02-26 07:07:19', '1', '2022-02-16 20:14:17', 0);
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (63, 1, '已处理', '1', 'infra_api_error_log_process_status', 0, 'success', '', NULL, '', '2021-02-26 07:07:26', '1', '2022-02-16 20:14:08', 0);
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (64, 2, '已忽略', '2', 'infra_api_error_log_process_status', 0, 'danger', '', NULL, '', '2021-02-26 07:07:34', '1', '2022-02-16 20:14:14', 0);
-INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (65, 1, '云片', 'YUN_PIAN', 'system_sms_channel_code', 0, 'success', '', NULL, '1', '2021-04-05 01:05:14', '1', '2022-02-16 10:09:55', 0);
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (66, 2, '阿里云', 'ALIYUN', 'system_sms_channel_code', 0, 'primary', '', NULL, '1', '2021-04-05 01:05:26', '1', '2022-02-16 10:09:52', 0);
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (67, 1, '验证码', '1', 'system_sms_template_type', 0, 'warning', '', NULL, '1', '2021-04-05 21:50:57', '1', '2022-02-16 12:48:30', 0);
 INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (68, 2, '通知', '2', 'system_sms_template_type', 0, 'primary', '', NULL, '1', '2021-04-05 21:51:08', '1', '2022-02-16 12:48:27', 0);
@@ -2358,38 +2357,58 @@ COMMIT;
 -- Table structure for system_dict_type
 -- ----------------------------
 DROP TABLE IF EXISTS "system_dict_type";
-CREATE TABLE "system_dict_type" (
-  "id" int8 NOT NULL,
-  "name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
-  "type" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
-  "status" int2 NOT NULL,
-  "remark" varchar(500) COLLATE "pg_catalog"."default",
-  "creator" varchar(64) COLLATE "pg_catalog"."default",
-  "create_time" timestamp(6) NOT NULL,
-  "updater" varchar(64) COLLATE "pg_catalog"."default",
-  "update_time" timestamp(6) NOT NULL,
-  "deleted" int2 NOT NULL DEFAULT 0
+CREATE TABLE "system_dict_type"(
+                                   "id"           int8                                        NOT NULL,
+                                   "name"         varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
+                                   "type"         varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
+                                   "status"       int2                                        NOT NULL,
+                                   "remark"       varchar(500) COLLATE "pg_catalog"."default",
+                                   "creator"      varchar(64) COLLATE "pg_catalog"."default",
+                                   "create_time"  timestamp(6)                                NOT NULL,
+                                   "updater"      varchar(64) COLLATE "pg_catalog"."default",
+                                   "update_time"  timestamp(6)                                NOT NULL,
+                                   "deleted_time" timestamp(6),
+                                   "deleted"      int2                                        NOT NULL DEFAULT 0
 )
 ;
-COMMENT ON COLUMN "system_dict_type"."id" IS '字典主键';
-COMMENT ON COLUMN "system_dict_type"."name" IS '字典名称';
-COMMENT ON COLUMN "system_dict_type"."type" IS '字典类型';
-COMMENT ON COLUMN "system_dict_type"."status" IS '状态(0正常 1停用)';
-COMMENT ON COLUMN "system_dict_type"."remark" IS '备注';
-COMMENT ON COLUMN "system_dict_type"."creator" IS '创建者';
-COMMENT ON COLUMN "system_dict_type"."create_time" IS '创建时间';
-COMMENT ON COLUMN "system_dict_type"."updater" IS '更新者';
-COMMENT ON COLUMN "system_dict_type"."update_time" IS '更新时间';
-COMMENT ON COLUMN "system_dict_type"."deleted" IS '是否删除';
-COMMENT ON TABLE "system_dict_type" IS '字典类型表';
+COMMENT
+ON COLUMN "system_dict_type"."id" IS '字典主键';
+COMMENT
+ON COLUMN "system_dict_type"."name" IS '字典名称';
+COMMENT
+ON COLUMN "system_dict_type"."type" IS '字典类型';
+COMMENT
+ON COLUMN "system_dict_type"."status" IS '状态(0正常 1停用)';
+COMMENT
+ON COLUMN "system_dict_type"."remark" IS '备注';
+COMMENT
+ON COLUMN "system_dict_type"."creator" IS '创建者';
+COMMENT
+ON COLUMN "system_dict_type"."create_time" IS '创建时间';
+COMMENT
+ON COLUMN "system_dict_type"."updater" IS '更新者';
+COMMENT
+ON COLUMN "system_dict_type"."update_time" IS '更新时间';
+COMMENT
+ON COLUMN "system_dict_type"."deleted_time" IS '删除时间';
+COMMENT
+ON COLUMN "system_dict_type"."deleted" IS '是否删除';
+COMMENT
+ON TABLE "system_dict_type" IS '字典类型表';
 
 -- ----------------------------
 -- Records of system_dict_type
 -- ----------------------------
 BEGIN;
-INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1, '用户性别', 'system_user_sex', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:30:31', 0);
-INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (6, '参数类型', 'infra_config_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:36:54', 0);
-INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (7, '通知类型', 'system_notice_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:35:26', 0);
+INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater",
+                                "update_time", "deleted")
+VALUES (1, '用户性别', 'system_user_sex', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:30:31', 0);
+INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater",
+                                "update_time", "deleted")
+VALUES (6, '参数类型', 'infra_config_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:36:54', 0);
+INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater",
+                                "update_time", "deleted")
+VALUES (7, '通知类型', 'system_notice_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:35:26', 0);
 INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (9, '操作类型', 'system_operate_type', 0, NULL, 'admin', '2021-01-05 17:03:48', '1', '2022-02-16 09:32:21', 0);
 INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (10, '系统状态', 'common_status', 0, NULL, 'admin', '2021-01-05 17:03:48', '', '2022-02-01 16:21:28', 0);
 INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (11, 'Boolean 是否类型', 'infra_boolean_string', 0, 'boolean 转是否', '', '2021-01-19 03:20:08', '', '2022-02-01 16:37:10', 0);
@@ -3519,7 +3538,6 @@ COMMENT ON TABLE "system_sms_channel" IS '短信渠道';
 -- Records of system_sms_channel
 -- ----------------------------
 BEGIN;
-INSERT INTO "system_sms_channel" ("id", "signature", "code", "status", "remark", "api_key", "api_secret", "callback_url", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1, '芋道', 'YUN_PIAN', 0, '呵呵呵哒', '1555a14277cb8a608cf45a9e6a80d510', NULL, 'http://vdwapu.natappfree.cc/admin-api/system/sms/callback/yunpian', '', '2021-03-31 06:12:20', '1', '2022-02-23 16:48:44', 0);
 INSERT INTO "system_sms_channel" ("id", "signature", "code", "status", "remark", "api_key", "api_secret", "callback_url", "creator", "create_time", "updater", "update_time", "deleted") VALUES (2, 'Ballcat', 'ALIYUN', 0, '啦啦啦', 'LTAI5tCnKso2uG3kJ5gRav88', 'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, '', '2021-03-31 11:53:10', '1', '2021-04-14 00:08:37', 0);
 INSERT INTO "system_sms_channel" ("id", "signature", "code", "status", "remark", "api_key", "api_secret", "callback_url", "creator", "create_time", "updater", "update_time", "deleted") VALUES (4, '测试渠道', 'DEBUG_DING_TALK', 0, '123', '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', '2021-04-13 00:23:14', '1', '2022-03-27 20:29:49', 0);
 INSERT INTO "system_sms_channel" ("id", "signature", "code", "status", "remark", "api_key", "api_secret", "callback_url", "creator", "create_time", "updater", "update_time", "deleted") VALUES (6, '测试演示', 'DEBUG_DING_TALK', 0, NULL, '696b5d8ead48071237e4aa5861ff08dbadb2b4ded1c688a7b7c9afc615579859', 'SEC5c4e5ff888bc8a9923ae47f59e7ccd30af1f14d93c55b4e2c9cb094e35aeed67', NULL, '1', '2022-04-10 23:07:59', '1', '2022-04-10 23:07:59', 0);

+ 130 - 101
sql/sqlserver/ruoyi-vue-pro.sql

@@ -5545,11 +5545,7 @@ GO
 INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'63', N'1', N'已处理', N'1', N'infra_api_error_log_process_status', N'0', N'success', N'', NULL, N'', N'2021-02-26 07:07:26.0000000', N'1', N'2022-02-16 20:14:08.0000000', N'0')
 GO
 
-INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'64', N'2', N'已忽略', N'2', N'infra_api_error_log_process_status', N'0', N'danger', N'', NULL, N'', N'2021-02-26 07:07:34.0000000', N'1', N'2022-02-16 20:14:14.0000000', N'0')
-GO
 
-INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'65', N'1', N'云片', N'YUN_PIAN', N'system_sms_channel_code', N'0', N'success', N'', NULL, N'1', N'2021-04-05 01:05:14.0000000', N'1', N'2022-02-16 10:09:55.0000000', N'0')
-GO
 
 INSERT INTO [dbo].[system_dict_data] ([id], [sort], [label], [value], [dict_type], [status], [color_type], [css_class], [remark], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'66', N'2', N'阿里云', N'ALIYUN', N'system_sms_channel_code', N'0', N'primary', N'', NULL, N'1', N'2021-04-05 01:05:26.0000000', N'1', N'2022-02-16 10:09:52.0000000', N'0')
 GO
@@ -5817,18 +5813,51 @@ IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sy
 	DROP TABLE [dbo].[system_dict_type]
 GO
 
-CREATE TABLE [dbo].[system_dict_type] (
-  [id] bigint  IDENTITY(1,1) NOT NULL,
-  [name] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
-  [type] nvarchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS  NOT NULL,
-  [status] tinyint  NOT NULL,
-  [remark] nvarchar(500) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
-  [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
-  [create_time] datetime2(7)  NOT NULL,
-  [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS  NULL,
-  [update_time] datetime2(7)  NOT NULL,
-  [deleted] bit DEFAULT 0 NOT NULL
-)
+CREATE TABLE [dbo].[system_dict_type]
+(
+    [
+    id]
+    bigint
+    IDENTITY
+(
+    1,
+    1
+) NOT NULL,
+    [name] nvarchar
+(
+    100
+) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
+    [type] nvarchar
+(
+    100
+) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
+    [status] tinyint NOT NULL,
+    [remark] nvarchar
+(
+    500
+) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
+    [creator] nvarchar
+(
+    64
+) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
+    [create_time] datetime2
+(
+    7
+) NOT NULL,
+    [updater] nvarchar
+(
+    64
+) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
+    [update_time] datetime2
+(
+    7
+) NOT NULL,
+    [deleted_time] datetime2
+(
+    7
+),
+    [deleted] bit DEFAULT 0 NOT NULL
+    )
 GO
 
 ALTER TABLE [dbo].[system_dict_type] SET (LOCK_ESCALATION = TABLE)
@@ -5886,26 +5915,29 @@ GO
 EXEC sp_addextendedproperty
 'MS_Description', N'更新者',
 'SCHEMA', N'dbo',
-'TABLE', N'system_dict_type',
-'COLUMN', N'updater'
-GO
-
-EXEC sp_addextendedproperty
-'MS_Description', N'更新时间',
-'SCHEMA', N'dbo',
-'TABLE', N'system_dict_type',
-'COLUMN', N'update_time'
-GO
-
-EXEC sp_addextendedproperty
-'MS_Description', N'是否删除',
-'SCHEMA', N'dbo',
-'TABLE', N'system_dict_type',
-'COLUMN', N'deleted'
-GO
-
-EXEC sp_addextendedproperty
-'MS_Description', N'字典类型表',
+    'TABLE', N'system_dict_type',
+    'COLUMN', N'updater'
+    GO
+    EXEC sp_addextendedproperty
+    'MS_Description', N'更新时间',
+    'SCHEMA', N'dbo',
+    'TABLE', N'system_dict_type',
+    'COLUMN', N'update_time'
+    GO
+    EXEC sp_addextendedproperty
+    'MS_Description', N'删除时间',
+    'SCHEMA', N'dbo',
+    'TABLE', N'system_dict_type',
+    'COLUMN', N'deleted_time'
+    GO
+    EXEC sp_addextendedproperty
+    'MS_Description', N'是否删除',
+    'SCHEMA', N'dbo',
+    'TABLE', N'system_dict_type',
+    'COLUMN', N'deleted'
+    GO
+    EXEC sp_addextendedproperty
+    'MS_Description', N'字典类型表',
 'SCHEMA', N'dbo',
 'TABLE', N'system_dict_type'
 GO
@@ -9623,9 +9655,6 @@ GO
 SET IDENTITY_INSERT [dbo].[system_sms_channel] ON
 GO
 
-INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'1', N'芋道', N'YUN_PIAN', N'0', N'呵呵呵哒', N'1555a14277cb8a608cf45a9e6a80d510', NULL, N'http://vdwapu.natappfree.cc/admin-api/system/sms/callback/yunpian', N'', N'2021-03-31 06:12:20.0000000', N'1', N'2022-02-23 16:48:44.0000000', N'0')
-GO
-
 INSERT INTO [dbo].[system_sms_channel] ([id], [signature], [code], [status], [remark], [api_key], [api_secret], [callback_url], [creator], [create_time], [updater], [update_time], [deleted]) VALUES (N'2', N'Ballcat', N'ALIYUN', N'0', N'啦啦啦', N'LTAI5tCnKso2uG3kJ5gRav88', N'fGJ5SNXL7P1NHNRmJ7DJaMJGPyE55C', NULL, N'', N'2021-03-31 11:53:10.0000000', N'1', N'2021-04-14 00:08:37.0000000', N'0')
 GO
 
@@ -11348,7 +11377,7 @@ GO
 -- Primary Key structure for table QRTZ_CALENDARS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_CALENDARS] ADD CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [CALENDAR_NAME])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11369,7 +11398,7 @@ GO
 -- Primary Key structure for table QRTZ_CRON_TRIGGERS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11378,7 +11407,7 @@ GO
 -- Primary Key structure for table QRTZ_FIRED_TRIGGERS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [ENTRY_ID])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11387,7 +11416,7 @@ GO
 -- Primary Key structure for table QRTZ_JOB_DETAILS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] ADD CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [JOB_NAME], [JOB_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11396,7 +11425,7 @@ GO
 -- Primary Key structure for table QRTZ_LOCKS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_LOCKS] ADD CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [LOCK_NAME])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11405,7 +11434,7 @@ GO
 -- Primary Key structure for table QRTZ_PAUSED_TRIGGER_GRPS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] ADD CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11414,7 +11443,7 @@ GO
 -- Primary Key structure for table QRTZ_SCHEDULER_STATE
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] ADD CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED ([SCHED_NAME], [INSTANCE_NAME])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11435,7 +11464,7 @@ GO
 -- Primary Key structure for table QRTZ_SIMPLE_TRIGGERS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11456,7 +11485,7 @@ GO
 -- Primary Key structure for table QRTZ_SIMPROP_TRIGGERS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11477,7 +11506,7 @@ GO
 -- Primary Key structure for table QRTZ_TRIGGERS
 -- ----------------------------
 ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED ([SCHED_NAME], [TRIGGER_NAME], [TRIGGER_GROUP])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11493,7 +11522,7 @@ GO
 -- Primary Key structure for table bpm_form
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_form] ADD CONSTRAINT [PK__bpm_form__3213E83F86C2B27F] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11509,7 +11538,7 @@ GO
 -- Primary Key structure for table bpm_oa_leave
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_oa_leave] ADD CONSTRAINT [PK__bpm_oa_l__3213E83F3569F596] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11525,7 +11554,7 @@ GO
 -- Primary Key structure for table bpm_process_definition_ext
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_process_definition_ext] ADD CONSTRAINT [PK__bpm_proc__3213E83F0A8AB015] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11541,7 +11570,7 @@ GO
 -- Primary Key structure for table bpm_process_instance_ext
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_process_instance_ext] ADD CONSTRAINT [PK__bpm_proc__3213E83FFD88328F] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11557,7 +11586,7 @@ GO
 -- Primary Key structure for table bpm_task_assign_rule
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_task_assign_rule] ADD CONSTRAINT [PK__bpm_task__3213E83F474371C5] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11573,7 +11602,7 @@ GO
 -- Primary Key structure for table bpm_task_ext
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_task_ext] ADD CONSTRAINT [PK__bpm_task__3213E83FD8AFE1F9] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11589,7 +11618,7 @@ GO
 -- Primary Key structure for table bpm_user_group
 -- ----------------------------
 ALTER TABLE [dbo].[bpm_user_group] ADD CONSTRAINT [PK__bpm_user__3213E83F25E4725B] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11605,7 +11634,7 @@ GO
 -- Primary Key structure for table infra_api_access_log
 -- ----------------------------
 ALTER TABLE [dbo].[infra_api_access_log] ADD CONSTRAINT [PK__infra_ap__3213E83F04F27A05] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11621,7 +11650,7 @@ GO
 -- Primary Key structure for table infra_api_error_log
 -- ----------------------------
 ALTER TABLE [dbo].[infra_api_error_log] ADD CONSTRAINT [PK__infra_ap__3213E83FCA2446D4] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11637,7 +11666,7 @@ GO
 -- Primary Key structure for table infra_codegen_column
 -- ----------------------------
 ALTER TABLE [dbo].[infra_codegen_column] ADD CONSTRAINT [PK__infra_co__3213E83FA9EC5005] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11653,7 +11682,7 @@ GO
 -- Primary Key structure for table infra_codegen_table
 -- ----------------------------
 ALTER TABLE [dbo].[infra_codegen_table] ADD CONSTRAINT [PK__infra_co__3213E83F555031D0] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11662,7 +11691,7 @@ GO
 -- Primary Key structure for table infra_config
 -- ----------------------------
 ALTER TABLE [dbo].[infra_config] ADD CONSTRAINT [PK__infra_co__3213E83FF4C71E85] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11678,7 +11707,7 @@ GO
 -- Primary Key structure for table infra_data_source_config
 -- ----------------------------
 ALTER TABLE [dbo].[infra_data_source_config] ADD CONSTRAINT [PK__infra_da__3213E83F02D21AEB] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11701,7 +11730,7 @@ GO
 -- Primary Key structure for table infra_file_config
 -- ----------------------------
 ALTER TABLE [dbo].[infra_file_config] ADD CONSTRAINT [PK__infra_fi__3213E83F8A7903EA] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11717,7 +11746,7 @@ GO
 -- Primary Key structure for table infra_file_content
 -- ----------------------------
 ALTER TABLE [dbo].[infra_file_content] ADD CONSTRAINT [PK__infra_fi__3213E83F033E6045] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11733,7 +11762,7 @@ GO
 -- Primary Key structure for table infra_job
 -- ----------------------------
 ALTER TABLE [dbo].[infra_job] ADD CONSTRAINT [PK__infra_jo__3213E83F3C7DE10C] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11749,7 +11778,7 @@ GO
 -- Primary Key structure for table infra_job_log
 -- ----------------------------
 ALTER TABLE [dbo].[infra_job_log] ADD CONSTRAINT [PK__infra_jo__3213E83F4CA8F353] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11772,7 +11801,7 @@ GO
 -- Primary Key structure for table member_user
 -- ----------------------------
 ALTER TABLE [dbo].[member_user] ADD CONSTRAINT [PK__member_u__3213E83F0A9AEC0B] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11788,7 +11817,7 @@ GO
 -- Primary Key structure for table pay_app
 -- ----------------------------
 ALTER TABLE [dbo].[pay_app] ADD CONSTRAINT [PK__pay_app__3213E83FB26E0A6B] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11804,7 +11833,7 @@ GO
 -- Primary Key structure for table pay_channel
 -- ----------------------------
 ALTER TABLE [dbo].[pay_channel] ADD CONSTRAINT [PK__pay_chan__3213E83F2556A7FC] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11820,7 +11849,7 @@ GO
 -- Primary Key structure for table pay_merchant
 -- ----------------------------
 ALTER TABLE [dbo].[pay_merchant] ADD CONSTRAINT [PK__pay_merc__3213E83F010D02B8] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11836,7 +11865,7 @@ GO
 -- Primary Key structure for table pay_notify_log
 -- ----------------------------
 ALTER TABLE [dbo].[pay_notify_log] ADD CONSTRAINT [PK__pay_noti__3213E83F5F4B3447] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11852,7 +11881,7 @@ GO
 -- Primary Key structure for table pay_notify_task
 -- ----------------------------
 ALTER TABLE [dbo].[pay_notify_task] ADD CONSTRAINT [PK__pay_noti__3213E83FB9215103] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11868,7 +11897,7 @@ GO
 -- Primary Key structure for table pay_order
 -- ----------------------------
 ALTER TABLE [dbo].[pay_order] ADD CONSTRAINT [PK__pay_orde__3213E83F34C95271] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11884,7 +11913,7 @@ GO
 -- Primary Key structure for table pay_order_extension
 -- ----------------------------
 ALTER TABLE [dbo].[pay_order_extension] ADD CONSTRAINT [PK__pay_orde__3213E83F5ACB776F] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11900,7 +11929,7 @@ GO
 -- Primary Key structure for table pay_refund
 -- ----------------------------
 ALTER TABLE [dbo].[pay_refund] ADD CONSTRAINT [PK__pay_refu__3213E83FBE1B54AC] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11916,7 +11945,7 @@ GO
 -- Primary Key structure for table system_dept
 -- ----------------------------
 ALTER TABLE [dbo].[system_dept] ADD CONSTRAINT [PK__system_d__3213E83FFA72847C] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11932,7 +11961,7 @@ GO
 -- Primary Key structure for table system_dict_data
 -- ----------------------------
 ALTER TABLE [dbo].[system_dict_data] ADD CONSTRAINT [PK__system_d__3213E83F20407597] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11948,7 +11977,7 @@ GO
 -- Primary Key structure for table system_dict_type
 -- ----------------------------
 ALTER TABLE [dbo].[system_dict_type] ADD CONSTRAINT [PK__system_d__3213E83F7C36B1FD] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11964,7 +11993,7 @@ GO
 -- Primary Key structure for table system_error_code
 -- ----------------------------
 ALTER TABLE [dbo].[system_error_code] ADD CONSTRAINT [PK__system_e__3213E83F68B8DFD0] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11980,7 +12009,7 @@ GO
 -- Primary Key structure for table system_login_log
 -- ----------------------------
 ALTER TABLE [dbo].[system_login_log] ADD CONSTRAINT [PK__system_l__3213E83F717953E9] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -11996,7 +12025,7 @@ GO
 -- Primary Key structure for table system_menu
 -- ----------------------------
 ALTER TABLE [dbo].[system_menu] ADD CONSTRAINT [PK__system_m__3213E83F14175801] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12012,7 +12041,7 @@ GO
 -- Primary Key structure for table system_notice
 -- ----------------------------
 ALTER TABLE [dbo].[system_notice] ADD CONSTRAINT [PK__system_n__3213E83FA158BA8D] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12035,7 +12064,7 @@ GO
 -- Primary Key structure for table system_oauth2_approve
 -- ----------------------------
 ALTER TABLE [dbo].[system_oauth2_approve] ADD CONSTRAINT [PK__system_o__3213E83F7CC08ED6] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12058,7 +12087,7 @@ GO
 -- Primary Key structure for table system_oauth2_code
 -- ----------------------------
 ALTER TABLE [dbo].[system_oauth2_code] ADD CONSTRAINT [PK__system_o__3213E83F38C13543] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12074,7 +12103,7 @@ GO
 -- Primary Key structure for table system_oauth2_refresh_token
 -- ----------------------------
 ALTER TABLE [dbo].[system_oauth2_refresh_token] ADD CONSTRAINT [PK__system_o__3213E83FCFB541CC] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12090,7 +12119,7 @@ GO
 -- Primary Key structure for table system_operate_log
 -- ----------------------------
 ALTER TABLE [dbo].[system_operate_log] ADD CONSTRAINT [PK__system_o__3213E83F85EC81FD] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12106,7 +12135,7 @@ GO
 -- Primary Key structure for table system_post
 -- ----------------------------
 ALTER TABLE [dbo].[system_post] ADD CONSTRAINT [PK__system_p__3213E83FBC098F34] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12122,7 +12151,7 @@ GO
 -- Primary Key structure for table system_role
 -- ----------------------------
 ALTER TABLE [dbo].[system_role] ADD CONSTRAINT [PK__system_r__3213E83F209B43F2] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12138,7 +12167,7 @@ GO
 -- Primary Key structure for table system_role_menu
 -- ----------------------------
 ALTER TABLE [dbo].[system_role_menu] ADD CONSTRAINT [PK__system_r__3213E83F6F1E4A9B] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12154,7 +12183,7 @@ GO
 -- Primary Key structure for table system_sensitive_word
 -- ----------------------------
 ALTER TABLE [dbo].[system_sensitive_word] ADD CONSTRAINT [PK__system_s__3213E83FFFD8E555] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12170,7 +12199,7 @@ GO
 -- Primary Key structure for table system_sms_channel
 -- ----------------------------
 ALTER TABLE [dbo].[system_sms_channel] ADD CONSTRAINT [PK__system_s__3213E83FA96B966E] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12186,7 +12215,7 @@ GO
 -- Primary Key structure for table system_sms_code
 -- ----------------------------
 ALTER TABLE [dbo].[system_sms_code] ADD CONSTRAINT [PK__system_s__3213E83F825CBCB9] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12202,7 +12231,7 @@ GO
 -- Primary Key structure for table system_sms_log
 -- ----------------------------
 ALTER TABLE [dbo].[system_sms_log] ADD CONSTRAINT [PK__system_s__3213E83F5F1968A9] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12218,7 +12247,7 @@ GO
 -- Primary Key structure for table system_sms_template
 -- ----------------------------
 ALTER TABLE [dbo].[system_sms_template] ADD CONSTRAINT [PK__system_s__3213E83F5C91CA37] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12234,7 +12263,7 @@ GO
 -- Primary Key structure for table system_social_user
 -- ----------------------------
 ALTER TABLE [dbo].[system_social_user] ADD CONSTRAINT [PK__system_s__3213E83F6EF3863C] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12250,7 +12279,7 @@ GO
 -- Primary Key structure for table system_social_user_bind
 -- ----------------------------
 ALTER TABLE [dbo].[system_social_user_bind] ADD CONSTRAINT [PK__system_s__3213E83F21F44049] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12266,7 +12295,7 @@ GO
 -- Primary Key structure for table system_tenant
 -- ----------------------------
 ALTER TABLE [dbo].[system_tenant] ADD CONSTRAINT [PK__system_t__3213E83FAF444092] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12282,7 +12311,7 @@ GO
 -- Primary Key structure for table system_tenant_package
 -- ----------------------------
 ALTER TABLE [dbo].[system_tenant_package] ADD CONSTRAINT [PK__system_t__3213E83FA2213DB5] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12298,7 +12327,7 @@ GO
 -- Primary Key structure for table system_user_post
 -- ----------------------------
 ALTER TABLE [dbo].[system_user_post] ADD CONSTRAINT [PK__system_u__3213E83F56DD4107] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12314,7 +12343,7 @@ GO
 -- Primary Key structure for table system_user_role
 -- ----------------------------
 ALTER TABLE [dbo].[system_user_role] ADD CONSTRAINT [PK__system_u__3213E83F3593F652] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 
@@ -12330,7 +12359,7 @@ GO
 -- Primary Key structure for table system_users
 -- ----------------------------
 ALTER TABLE [dbo].[system_users] ADD CONSTRAINT [PK__system_u__3213E83F7CF2516E] PRIMARY KEY CLUSTERED ([id])
-WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
+WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
 ON [PRIMARY]
 GO
 

+ 114 - 59
yudao-dependencies/pom.xml

@@ -14,57 +14,61 @@
     <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
 
     <properties>
-        <revision>1.6.3-snapshot</revision>
+        <revision>1.6.6-snapshot</revision>
         <!-- 统一依赖管理 -->
-        <spring.boot.version>2.6.10</spring.boot.version>
+        <spring.boot.version>2.7.7</spring.boot.version>
         <!-- Web 相关 -->
-        <knife4j.version>3.0.3</knife4j.version>
-        <swagger-annotations.version>1.6.6</swagger-annotations.version>
+        <knife4j.version>4.0.0</knife4j.version>
+        <swagger-annotations.version>1.6.8</swagger-annotations.version>
         <servlet.versoin>2.5</servlet.versoin>
         <!-- DB 相关 -->
-        <druid.version>1.2.11</druid.version>
-        <mybatis-plus.version>3.5.2</mybatis-plus.version>
-        <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version>
-        <dynamic-datasource.version>3.5.0</dynamic-datasource.version>
-        <redisson.version>3.17.4</redisson.version>
-        <!-- Config 配置中心相关 -->
-        <apollo.version>1.9.2</apollo.version>
+        <druid.version>1.2.15</druid.version>
+        <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
+        <mybatis-plus-generator.version>3.5.3.1</mybatis-plus-generator.version>
+        <dynamic-datasource.version>3.6.1</dynamic-datasource.version>
+        <redisson.version>3.18.0</redisson.version>
         <!-- 服务保障相关 -->
-        <lock4j.version>2.2.0</lock4j.version>
+        <lock4j.version>2.2.3</lock4j.version>
         <resilience4j.version>1.7.1</resilience4j.version>
         <!-- 监控相关 -->
-        <skywalking.version>8.7.0</skywalking.version>
-        <spring-boot-admin.version>2.6.7</spring-boot-admin.version>
-        <opentracing.version>0.31.0</opentracing.version>
+        <skywalking.version>8.12.0</skywalking.version>
+        <spring-boot-admin.version>2.7.10</spring-boot-admin.version>
+        <opentracing.version>0.33.0</opentracing.version>
         <!-- Test 测试相关 -->
-        <podam.version>7.2.6.RELEASE</podam.version>
-        <jedis-mock.version>0.1.16</jedis-mock.version>
-        <mockito-inline.version>4.0.0</mockito-inline.version>
+        <podam.version>7.2.11.RELEASE</podam.version>
+        <jedis-mock.version>1.0.5</jedis-mock.version>
+        <mockito-inline.version>4.11.0</mockito-inline.version>
         <!-- Bpm 工作流相关 -->
-        <flowable.version>6.7.0</flowable.version>
+        <flowable.version>6.8.0</flowable.version>
         <!-- 工具类相关 -->
-        <jasypt-spring-boot-starter.version>3.0.4</jasypt-spring-boot-starter.version>
-        <lombok.version>1.18.20</lombok.version>
-        <mapstruct.version>1.4.1.Final</mapstruct.version>
-        <hutool.version>5.7.22</hutool.version>
-        <easyexcel.verion>3.1.1</easyexcel.verion>
-        <velocity.version>2.2</velocity.version>
+        <captcha-plus.version>1.0.1</captcha-plus.version>
+        <jsoup.version>1.15.3</jsoup.version>
+        <lombok.version>1.18.24</lombok.version>
+        <mapstruct.version>1.5.3.Final</mapstruct.version>
+        <hutool.version>5.8.11</hutool.version>
+        <easyexcel.verion>3.1.5</easyexcel.verion>
+        <velocity.version>2.3</velocity.version>
         <screw.version>1.0.5</screw.version>
-		<fastjson.version>1.2.83</fastjson.version>
-        <guava.version>30.1.1-jre</guava.version>
+        <fastjson.version>1.2.83</fastjson.version>
+        <guava.version>31.1-jre</guava.version>
         <guice.version>5.1.0</guice.version>
-        <transmittable-thread-local.version>2.12.2</transmittable-thread-local.version>
+        <transmittable-thread-local.version>2.14.2</transmittable-thread-local.version>
         <commons-net.version>3.8.0</commons-net.version>
         <jsch.version>0.1.55</jsch.version>
-        <tika-core.version>2.4.1</tika-core.version>
+        <tika-core.version>2.6.0</tika-core.version>
+        <netty-all.version>4.1.86.Final</netty-all.version>
+        <ip2region.version>2.6.6</ip2region.version>
         <!-- 三方云服务相关 -->
-        <minio.version>8.2.2</minio.version>
-        <aliyun-java-sdk-core.version>4.5.25</aliyun-java-sdk-core.version>
-        <aliyun-java-sdk-dysmsapi.version>2.1.0</aliyun-java-sdk-dysmsapi.version>
-        <tencentcloud-sdk-java.version>3.1.471</tencentcloud-sdk-java.version>
-        <yunpian-java-sdk.version>1.2.7</yunpian-java-sdk.version>
+        <okio.version>3.0.0</okio.version>
+        <okhttp3.version>4.10.0</okhttp3.version>
+        <minio.version>8.5.1</minio.version>
+        <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version>
+        <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
+        <tencentcloud-sdk-java.version>3.1.676</tencentcloud-sdk-java.version>
         <justauth.version>1.4.0</justauth.version>
-        <jimureport.version>1.5.2</jimureport.version>
+        <jimureport.version>1.5.6</jimureport.version>
+        <xercesImpl.version>2.12.2</xercesImpl.version>
+        <wx-java-mp.version>4.3.0</wx-java-mp.version>
     </properties>
 
     <dependencyManagement>
@@ -129,6 +133,21 @@
                 <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>
                 <version>${revision}</version>
             </dependency>
+            <dependency>
+                <groupId>cn.iocoder.boot</groupId>
+                <artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
+                <version>${revision}</version>
+            </dependency>
+            <dependency>
+                <groupId>cn.iocoder.boot</groupId>
+                <artifactId>yudao-spring-boot-starter-captcha</artifactId>
+                <version>${revision}</version>
+            </dependency>
+            <dependency>
+                <groupId>cn.iocoder.boot</groupId>
+                <artifactId>yudao-spring-boot-starter-desensitize</artifactId>
+                <version>${revision}</version>
+            </dependency>
 
             <!-- Spring 核心 -->
             <dependency>
@@ -153,7 +172,7 @@
 
             <dependency>
                 <groupId>com.github.xiaoymin</groupId>
-                <artifactId>knife4j-spring-boot-starter</artifactId>
+                <artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
                 <version>${knife4j.version}</version>
                 <exclusions>
                     <exclusion>
@@ -217,17 +236,6 @@
             </dependency>
 
             <!-- Config 配置中心相关 -->
-            <dependency>
-                <groupId>cn.iocoder.boot</groupId>
-                <artifactId>yudao-spring-boot-starter-config</artifactId>
-                <version>${revision}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>com.ctrip.framework.apollo</groupId>
-                <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 -->
-                <version>${apollo.version}</version>
-            </dependency>
 
             <!-- Job 定时任务相关 -->
             <dependency>
@@ -399,12 +407,6 @@
                 <version>${revision}</version>
             </dependency>
 
-            <dependency>
-                <groupId>com.github.ulisesbocchio</groupId>
-                <artifactId>jasypt-spring-boot-starter</artifactId> <!-- 加解密 -->
-                <version>${jasypt-spring-boot-starter.version}</version>
-            </dependency>
-
             <dependency>
                 <groupId>cn.iocoder.boot</groupId>
                 <artifactId>yudao-spring-boot-starter-excel</artifactId>
@@ -502,13 +504,48 @@
                 <artifactId>commons-net</artifactId> <!-- 解决 ftp 连接 -->
                 <version>${commons-net.version}</version>
             </dependency>
+
             <dependency>
                 <groupId>com.jcraft</groupId>
                 <artifactId>jsch</artifactId> <!-- 解决 sftp 连接 -->
                 <version>${jsch.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-all</artifactId>
+                <version>${netty-all.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.xingyuv</groupId>
+                <artifactId>spring-boot-starter-captcha-plus</artifactId>
+                <version>${captcha-plus.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.lionsoul</groupId>
+                <artifactId>ip2region</artifactId>
+                <version>${ip2region.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.jsoup</groupId>
+                <artifactId>jsoup</artifactId>
+                <version>${jsoup.version}</version>
+            </dependency>
+
             <!-- 三方云服务相关 -->
+            <dependency>
+                <groupId>com.squareup.okio</groupId>
+                <artifactId>okio</artifactId>
+                <version>${okio.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.squareup.okhttp3</groupId>
+                <artifactId>okhttp</artifactId>
+                <version>${okhttp3.version}</version>
+            </dependency>
             <dependency>
                 <groupId>cn.iocoder.boot</groupId>
                 <artifactId>yudao-spring-boot-starter-file</artifactId>
@@ -521,11 +558,6 @@
             </dependency>
 
             <!-- SMS SDK begin -->
-            <dependency>
-                <groupId>com.yunpian.sdk</groupId>
-                <artifactId>yunpian-java-sdk</artifactId>
-                <version>${yunpian-java-sdk.version}</version>
-            </dependency>
             <dependency>
                 <groupId>com.aliyun</groupId>
                 <artifactId>aliyun-java-sdk-core</artifactId>
@@ -548,7 +580,7 @@
             </dependency>
             <dependency>
                 <groupId>com.tencentcloudapi</groupId>
-                <artifactId>tencentcloud-sdk-java</artifactId>
+                <artifactId>tencentcloud-sdk-java-sms</artifactId>
                 <version>${tencentcloud-sdk-java.version}</version>
             </dependency>
             <!-- SMS SDK end -->
@@ -559,11 +591,34 @@
                 <version>${justauth.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>com.github.binarywang</groupId>
+                <artifactId>wx-java-mp-spring-boot-starter</artifactId>
+                <version>${wx-java-mp.version}</version>
+            </dependency>
+
             <!-- 积木报表-->
             <dependency>
                 <groupId>org.jeecgframework.jimureport</groupId>
                 <artifactId>jimureport-spring-boot-starter</artifactId>
                 <version>${jimureport.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>com.alibaba</groupId>
+                        <artifactId>druid</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>xerces</groupId>
+                <artifactId>xercesImpl</artifactId>
+                <version>${xercesImpl.version}</version>
+            </dependency>
+            <!-- SpringBoot Websocket -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-websocket</artifactId>
+                <version>${spring.boot.version}</version>
             </dependency>
         </dependencies>
     </dependencyManagement>

+ 22 - 0
yudao-example/pom.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- 由于方便大家拷贝,使用不使用 yudao 作为 Maven parent -->
+
+    <groupId>cn.iocoder.boot</groupId>
+    <artifactId>yudao-example</artifactId>
+    <version>1.0.0-snapshot</version>
+    <packaging>pom</packaging>
+    <modules>
+        <module>yudao-sso-demo-by-code</module>
+        <module>yudao-sso-demo-by-password</module>
+    </modules>
+
+    <name>${project.artifactId}</name>
+    <description>提供各种示例,例如说:SSO 单点登录</description>
+    <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
+
+</project>

+ 65 - 0
yudao-example/yudao-sso-demo-by-code/pom.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- 由于方便大家拷贝,使用不使用 yudao 作为 Maven parent -->
+
+    <groupId>cn.iocoder.boot</groupId>
+    <artifactId>yudao-sso-demo-by-code</artifactId>
+    <version>1.0.0-snapshot</version>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>基于授权码模式,如何实现 SSO 单点登录?</description>
+    <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
+
+    <properties>
+        <!-- Maven 相关 -->
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <!-- 统一依赖管理 -->
+        <spring.boot.version>2.7.7</spring.boot.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- 统一依赖管理 -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Web 相关 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.11</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+</project>

+ 13 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/SSODemoApplication.java

@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.ssodemo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SSODemoApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SSODemoApplication.class, args);
+    }
+
+}

+ 157 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/OAuth2Client.java

@@ -0,0 +1,157 @@
+package cn.iocoder.yudao.ssodemo.client;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2AccessTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2CheckTokenRespDTO;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
+import org.springframework.util.Base64Utils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * OAuth 2.0 客户端
+ *
+ * 对应调用 OAuth2OpenController 接口
+ */
+@Component
+public class OAuth2Client {
+
+    private static final String BASE_URL = "http://127.0.0.1:48080/admin-api/system/oauth2";
+
+    /**
+     * 租户编号
+     *
+     * 默认使用 1;如果使用别的租户,可以调整
+     */
+    public static final Long TENANT_ID = 1L;
+
+    private static final String CLIENT_ID = "yudao-sso-demo-by-code";
+    private static final String CLIENT_SECRET = "test";
+
+
+//    @Resource // 可优化,注册一个 RestTemplate Bean,然后注入
+    private final RestTemplate restTemplate = new RestTemplate();
+
+    /**
+     * 使用 code 授权码,获得访问令牌
+     *
+     * @param code        授权码
+     * @param redirectUri 重定向 URI
+     * @return 访问令牌
+     */
+    public CommonResult<OAuth2AccessTokenRespDTO> postAccessToken(String code, String redirectUri) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("grant_type", "authorization_code");
+        body.add("code", code);
+        body.add("redirect_uri", redirectUri);
+//        body.add("state", ""); // 选填;填了会校验
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<OAuth2AccessTokenRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/token",
+                HttpMethod.POST,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<OAuth2AccessTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    /**
+     * 校验访问令牌,并返回它的基本信息
+     *
+     * @param token 访问令牌
+     * @return 访问令牌的基本信息
+     */
+    public CommonResult<OAuth2CheckTokenRespDTO> checkToken(String token) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("token", token);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<OAuth2CheckTokenRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/check-token",
+                HttpMethod.POST,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<OAuth2CheckTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    /**
+     * 使用刷新令牌,获得(刷新)访问令牌
+     *
+     * @param refreshToken 刷新令牌
+     * @return 访问令牌
+     */
+    public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(String refreshToken) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("grant_type", "refresh_token");
+        body.add("refresh_token", refreshToken);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<OAuth2AccessTokenRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/token",
+                HttpMethod.POST,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<OAuth2AccessTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    /**
+     * 删除访问令牌
+     *
+     * @param token 访问令牌
+     * @return 成功
+     */
+    public CommonResult<Boolean> revokeToken(String token) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("token", token);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange(
+                BASE_URL + "/token",
+                HttpMethod.DELETE,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    private static void addClientHeader(HttpHeaders headers) {
+        // client 拼接,需要 BASE64 编码
+        String client = CLIENT_ID + ":" + CLIENT_SECRET;
+        client = Base64Utils.encodeToString(client.getBytes(StandardCharsets.UTF_8));
+        headers.add("Authorization", "Basic " + client);
+    }
+
+}

+ 73 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/UserClient.java

@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.ssodemo.client;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserInfoRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserUpdateReqDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 用户 User 信息的客户端
+ *
+ * 对应调用 OAuth2UserController 接口
+ */
+@Component
+public class UserClient {
+
+    private static final String BASE_URL = "http://127.0.0.1:48080/admin-api//system/oauth2/user";
+
+    //    @Resource // 可优化,注册一个 RestTemplate Bean,然后注入
+    private final RestTemplate restTemplate = new RestTemplate();
+
+    public CommonResult<UserInfoRespDTO> getUser() {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", OAuth2Client.TENANT_ID.toString());
+        addTokenHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<UserInfoRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/get",
+                HttpMethod.GET,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<UserInfoRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    public CommonResult<Boolean> updateUser(UserUpdateReqDTO updateReqDTO) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+        headers.set("tenant-id", OAuth2Client.TENANT_ID.toString());
+        addTokenHeader(headers);
+        // 1.2 构建请求参数
+        // 使用 updateReqDTO 即可
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange(
+                BASE_URL + "/update",
+                HttpMethod.PUT,
+                new HttpEntity<>(updateReqDTO, headers),
+                new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+
+    private static void addTokenHeader(HttpHeaders headers) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        Assert.notNull(loginUser, "登录用户不能为空");
+        headers.add("Authorization", "Bearer " + loginUser.getAccessToken());
+    }
+}

+ 28 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/CommonResult.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.ssodemo.client.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 通用返回
+ *
+ * @param <T> 数据泛型
+ */
+@Data
+public class CommonResult<T> implements Serializable {
+
+    /**
+     * 错误码
+     */
+    private Integer code;
+    /**
+     * 返回数据
+     */
+    private T data;
+    /**
+     * 错误提示,用户可阅读
+     */
+    private String msg;
+
+}

+ 45 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2AccessTokenRespDTO.java

@@ -0,0 +1,45 @@
+package cn.iocoder.yudao.ssodemo.client.dto.oauth2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 访问令牌 Response DTO
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class OAuth2AccessTokenRespDTO {
+
+    /**
+     * 访问令牌
+     */
+    @JsonProperty("access_token")
+    private String accessToken;
+
+    /**
+     * 刷新令牌
+     */
+    @JsonProperty("refresh_token")
+    private String refreshToken;
+
+    /**
+     * 令牌类型
+     */
+    @JsonProperty("token_type")
+    private String tokenType;
+
+    /**
+     * 过期时间;单位:秒
+     */
+    @JsonProperty("expires_in")
+    private Long expiresIn;
+
+    /**
+     * 授权范围;如果多个授权范围,使用空格分隔
+     */
+    private String scope;
+
+}

+ 59 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2CheckTokenRespDTO.java

@@ -0,0 +1,59 @@
+package cn.iocoder.yudao.ssodemo.client.dto.oauth2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 校验令牌 Response DTO
+ *
+ * @author 芋道源码
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class OAuth2CheckTokenRespDTO {
+
+    /**
+     * 用户编号
+     */
+    @JsonProperty("user_id")
+    private Long userId;
+    /**
+     * 用户类型
+     */
+    @JsonProperty("user_type")
+    private Integer userType;
+    /**
+     * 租户编号
+     */
+    @JsonProperty("tenant_id")
+    private Long tenantId;
+
+    /**
+     * 客户端编号
+     */
+    @JsonProperty("client_id")
+    private String clientId;
+    /**
+     * 授权范围
+     */
+    private List<String> scopes;
+
+    /**
+     * 访问令牌
+     */
+    @JsonProperty("access_token")
+    private String accessToken;
+
+    /**
+     * 过期时间
+     *
+     * 时间戳 / 1000,即单位:秒
+     */
+    private Long exp;
+
+}

+ 97 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserInfoRespDTO.java

@@ -0,0 +1,97 @@
+package cn.iocoder.yudao.ssodemo.client.dto.user;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 获得用户基本信息 Response dto
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UserInfoRespDTO {
+
+    /**
+     * 用户编号
+     */
+    private Long id;
+
+    /**
+     * 用户账号
+     */
+    private String username;
+
+    /**
+     * 用户昵称
+     */
+    private String nickname;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+    /**
+     * 手机号码
+     */
+    private String mobile;
+
+    /**
+     * 用户性别
+     */
+    private Integer sex;
+
+    /**
+     * 用户头像
+     */
+    private String avatar;
+
+    /**
+     * 所在部门
+     */
+    private Dept dept;
+
+    /**
+     * 所属岗位数组
+     */
+    private List<Post> posts;
+
+    /**
+     * 部门
+     */
+    @Data
+    public static class Dept {
+
+        /**
+         * 部门编号
+         */
+        private Long id;
+
+        /**
+         * 部门名称
+         */
+        private String name;
+
+    }
+
+    /**
+     * 岗位
+     */
+    @Data
+    public static class Post {
+
+        /**
+         * 岗位编号
+         */
+        private Long id;
+
+        /**
+         * 岗位名称
+         */
+        private String name;
+
+    }
+
+}

+ 35 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserUpdateReqDTO.java

@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.ssodemo.client.dto.user;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 更新用户基本信息 Request DTO
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UserUpdateReqDTO {
+
+    /**
+     * 用户昵称
+     */
+    private String nickname;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 手机号码
+     */
+    private String mobile;
+
+    /**
+     * 用户性别
+     */
+    private Integer sex;
+
+}

+ 63 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.ssodemo.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.ssodemo.client.OAuth2Client;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2AccessTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping("/auth")
+public class AuthController {
+
+    @Resource
+    private OAuth2Client oauth2Client;
+
+    /**
+     * 使用 code 访问令牌,获得访问令牌
+     *
+     * @param code 授权码
+     * @param redirectUri 重定向 URI
+     * @return 访问令牌;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段
+     */
+    @PostMapping("/login-by-code")
+    public CommonResult<OAuth2AccessTokenRespDTO> loginByCode(@RequestParam("code") String code,
+                                                              @RequestParam("redirectUri") String redirectUri) {
+        return oauth2Client.postAccessToken(code, redirectUri);
+    }
+
+    /**
+     * 使用刷新令牌,获得(刷新)访问令牌
+     *
+     * @param refreshToken 刷新令牌
+     * @return 访问令牌;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段
+     */
+    @PostMapping("/refresh-token")
+    public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(@RequestParam("refreshToken") String refreshToken) {
+        return oauth2Client.refreshToken(refreshToken);
+    }
+
+    /**
+     * 退出登录
+     *
+     * @param request 请求
+     * @return 成功
+     */
+    @PostMapping("/logout")
+    public CommonResult<Boolean> logout(HttpServletRequest request) {
+        String token = SecurityUtils.obtainAuthorization(request, "Authorization");
+        if (StrUtil.isNotBlank(token)) {
+            return oauth2Client.revokeToken(token);
+        }
+        // 返回成功
+        return new CommonResult<>();
+    }
+
+}

+ 40 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/controller/UserController.java

@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.ssodemo.controller;
+
+import cn.iocoder.yudao.ssodemo.client.UserClient;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserInfoRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserUpdateReqDTO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/user")
+public class UserController {
+
+    @Resource
+    private UserClient userClient;
+
+    /**
+     * 获得当前登录用户的基本信息
+     *
+     * @return 用户信息;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段
+     */
+    @GetMapping("/get")
+    public CommonResult<UserInfoRespDTO> getUser() {
+        return userClient.getUser();
+    }
+
+    /**
+     * 更新当前登录用户的昵称
+     *
+     * @param nickname 昵称
+     * @return 成功
+     */
+    @PutMapping("/update")
+    public CommonResult<Boolean> updateUser(@RequestParam("nickname") String nickname) {
+        UserUpdateReqDTO updateReqDTO = new UserUpdateReqDTO(nickname, null, null, null);
+        return userClient.updateUser(updateReqDTO);
+    }
+
+}

+ 52 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java

@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.ssodemo.framework.config;
+
+import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
+import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.SecurityFilterChain;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+import javax.annotation.Resource;
+
+@Configuration(proxyBeanMethods = false)
+@EnableWebSecurity
+public class SecurityConfiguration{
+
+    @Resource
+    private TokenAuthenticationFilter tokenAuthenticationFilter;
+
+    @Resource
+    private AccessDeniedHandlerImpl accessDeniedHandler;
+    @Resource
+    private AuthenticationEntryPoint authenticationEntryPoint;
+
+    @Bean
+    protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
+        // 设置 URL 安全权限
+        httpSecurity.csrf().disable() // 禁用 CSRF 保护
+                .authorizeRequests()
+                // 1. 静态资源,可匿名访问
+                .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
+                // 2. 登录相关的接口,可匿名访问
+                .antMatchers("/auth/login-by-code").permitAll()
+                .antMatchers("/auth/refresh-token").permitAll()
+                .antMatchers("/auth/logout").permitAll()
+                // last. 兜底规则,必须认证
+                .and().authorizeRequests()
+                .anyRequest().authenticated();
+
+        // 设置处理器
+        httpSecurity.exceptionHandling().accessDeniedHandler(accessDeniedHandler)
+                .authenticationEntryPoint(authenticationEntryPoint);
+
+        // 添加 Token Filter
+        httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
+        return httpSecurity.build();
+    }
+
+}

+ 37 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/LoginUser.java

@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.ssodemo.framework.core;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 登录用户信息
+ *
+ * @author 芋道源码
+ */
+@Data
+public class LoginUser {
+
+    /**
+     * 用户编号
+     */
+    private Long id;
+    /**
+     * 用户类型
+     */
+    private Integer userType;
+    /**
+     * 租户编号
+     */
+    private Long tenantId;
+    /**
+     * 授权范围
+     */
+    private List<String> scopes;
+
+    /**
+     * 访问令牌
+     */
+    private String accessToken;
+
+}

+ 66 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java

@@ -0,0 +1,66 @@
+package cn.iocoder.yudao.ssodemo.framework.core.filter;
+
+import cn.iocoder.yudao.ssodemo.client.OAuth2Client;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2CheckTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.annotation.Resource;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Token 过滤器,验证 token 的有效性
+ * 验证通过后,获得 {@link LoginUser} 信息,并加入到 Spring Security 上下文
+ *
+ * @author 芋道源码
+ */
+@Component
+public class TokenAuthenticationFilter extends OncePerRequestFilter {
+
+    @Resource
+    private OAuth2Client oauth2Client;
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
+                                    FilterChain filterChain) throws ServletException, IOException {
+        // 1. 获得访问令牌
+        String token = SecurityUtils.obtainAuthorization(request, "Authorization");
+        if (StringUtils.hasText(token)) {
+            // 2. 基于 token 构建登录用户
+            LoginUser loginUser = buildLoginUserByToken(token);
+            // 3. 设置当前用户
+            if (loginUser != null) {
+                SecurityUtils.setLoginUser(loginUser, request);
+            }
+        }
+
+        // 继续过滤链
+        filterChain.doFilter(request, response);
+    }
+
+    private LoginUser buildLoginUserByToken(String token) {
+        try {
+            CommonResult<OAuth2CheckTokenRespDTO> accessTokenResult = oauth2Client.checkToken(token);
+            OAuth2CheckTokenRespDTO accessToken = accessTokenResult.getData();
+            if (accessToken == null) {
+                return null;
+            }
+            // 构建登录用户
+            return new LoginUser().setId(accessToken.getUserId()).setUserType(accessToken.getUserType())
+                    .setTenantId(accessToken.getTenantId()).setScopes(accessToken.getScopes())
+                    .setAccessToken(accessToken.getAccessToken());
+        } catch (Exception exception) {
+            // 校验 Token 不通过时,考虑到一些接口是无需登录的,所以直接返回 null 即可
+            return null;
+        }
+    }
+
+}

+ 44 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AccessDeniedHandlerImpl.java

@@ -0,0 +1,44 @@
+package cn.iocoder.yudao.ssodemo.framework.core.handler;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import cn.iocoder.yudao.ssodemo.framework.core.util.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.security.web.access.ExceptionTranslationFilter;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 访问一个需要认证的 URL 资源,已经认证(登录)但是没有权限的情况下,返回 {@link GlobalErrorCodeConstants#FORBIDDEN} 错误码。
+ *
+ * 补充:Spring Security 通过 {@link ExceptionTranslationFilter#handleAccessDeniedException(HttpServletRequest, HttpServletResponse, FilterChain, AccessDeniedException)} 方法,调用当前类
+ *
+ * @author 芋道源码
+ */
+@Component
+@SuppressWarnings("JavadocReference")
+@Slf4j
+public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
+
+    @Override
+    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e)
+            throws IOException, ServletException {
+        // 打印 warn 的原因是,不定期合并 warn,看看有没恶意破坏
+        log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(),
+                SecurityUtils.getLoginUserId(), e);
+        // 返回 403
+        CommonResult<Object> result = new CommonResult<>();
+        result.setCode(HttpStatus.FORBIDDEN.value());
+        result.setMsg("没有该操作权限");
+        ServletUtils.writeJSON(response, result);
+    }
+
+}

+ 36 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AuthenticationEntryPointImpl.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.ssodemo.framework.core.handler;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.framework.core.util.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.access.ExceptionTranslationFilter;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.FilterChain;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 访问一个需要认证的 URL 资源,但是此时自己尚未认证(登录)的情况下,返回 {@link GlobalErrorCodeConstants#UNAUTHORIZED} 错误码,从而使前端重定向到登录页
+ *
+ * 补充:Spring Security 通过 {@link ExceptionTranslationFilter#sendStartAuthentication(HttpServletRequest, HttpServletResponse, FilterChain, AuthenticationException)} 方法,调用当前类
+ */
+@Component
+@Slf4j
+@SuppressWarnings("JavadocReference") // 忽略文档引用报错
+public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint {
+
+    @Override
+    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
+        log.debug("[commence][访问 URL({}) 时,没有登录]", request.getRequestURI(), e);
+        // 返回 401
+        CommonResult<Object> result = new CommonResult<>();
+        result.setCode(HttpStatus.UNAUTHORIZED.value());
+        result.setMsg("账号未登录");
+        ServletUtils.writeJSON(response, result);
+    }
+
+}

+ 103 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/SecurityUtils.java

@@ -0,0 +1,103 @@
+package cn.iocoder.yudao.ssodemo.framework.core.util;
+
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import org.springframework.lang.Nullable;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collections;
+
+/**
+ * 安全服务工具类
+ *
+ * @author 芋道源码
+ */
+public class SecurityUtils {
+
+    public static final String AUTHORIZATION_BEARER = "Bearer";
+
+    private SecurityUtils() {}
+
+    /**
+     * 从请求中,获得认证 Token
+     *
+     * @param request 请求
+     * @param header 认证 Token 对应的 Header 名字
+     * @return 认证 Token
+     */
+    public static String obtainAuthorization(HttpServletRequest request, String header) {
+        String authorization = request.getHeader(header);
+        if (!StringUtils.hasText(authorization)) {
+            return null;
+        }
+        int index = authorization.indexOf(AUTHORIZATION_BEARER + " ");
+        if (index == -1) { // 未找到
+            return null;
+        }
+        return authorization.substring(index + 7).trim();
+    }
+
+    /**
+     * 获得当前认证信息
+     *
+     * @return 认证信息
+     */
+    public static Authentication getAuthentication() {
+        SecurityContext context = SecurityContextHolder.getContext();
+        if (context == null) {
+            return null;
+        }
+        return context.getAuthentication();
+    }
+
+    /**
+     * 获取当前用户
+     *
+     * @return 当前用户
+     */
+    @Nullable
+    public static LoginUser getLoginUser() {
+        Authentication authentication = getAuthentication();
+        if (authentication == null) {
+            return null;
+        }
+        return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null;
+    }
+
+    /**
+     * 获得当前用户的编号,从上下文中
+     *
+     * @return 用户编号
+     */
+    @Nullable
+    public static Long getLoginUserId() {
+        LoginUser loginUser = getLoginUser();
+        return loginUser != null ? loginUser.getId() : null;
+    }
+
+    /**
+     * 设置当前用户
+     *
+     * @param loginUser 登录用户
+     * @param request 请求
+     */
+    public static void setLoginUser(LoginUser loginUser, HttpServletRequest request) {
+        // 创建 Authentication,并设置到上下文
+        Authentication authentication = buildAuthentication(loginUser, request);
+        SecurityContextHolder.getContext().setAuthentication(authentication);
+    }
+
+    private static Authentication buildAuthentication(LoginUser loginUser, HttpServletRequest request) {
+        // 创建 UsernamePasswordAuthenticationToken 对象
+        UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
+                loginUser, null, Collections.emptyList());
+        authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+        return authenticationToken;
+    }
+
+}

+ 28 - 0
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/ServletUtils.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.ssodemo.framework.core.util;
+
+import cn.hutool.extra.servlet.ServletUtil;
+import cn.hutool.json.JSONUtil;
+import org.springframework.http.MediaType;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 客户端工具类
+ *
+ * @author 芋道源码
+ */
+public class ServletUtils {
+
+    /**
+     * 返回 JSON 字符串
+     *
+     * @param response 响应
+     * @param object 对象,会序列化成 JSON 字符串
+     */
+    @SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE,否则会乱码
+    public static void writeJSON(HttpServletResponse response, Object object) {
+        String content = JSONUtil.toJsonStr(object);
+        ServletUtil.write(response, content, MediaType.APPLICATION_JSON_UTF8_VALUE);
+    }
+
+}

+ 2 - 0
yudao-example/yudao-sso-demo-by-code/src/main/resources/application.yaml

@@ -0,0 +1,2 @@
+server:
+  port: 18080

+ 61 - 0
yudao-example/yudao-sso-demo-by-code/src/main/resources/static/callback.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8">
+	<title>SSO 授权后的回调页</title>
+	<!-- jQuery:操作 dom、发起请求等 -->
+	<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.2/jquery.min.js" type="application/javascript"></script>
+	<!-- 工具类 -->
+	<script type="application/javascript">
+    (function ($) {
+      /**
+       * 获得 URL 的指定参数的值
+       *
+       * @param name 参数名
+       * @returns 参数值
+       */
+      $.getUrlParam = function (name) {
+        const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+        const r = window.location.search.substr(1).match(reg);
+        if (r != null) return unescape(r[2]); return null;
+      }
+    })(jQuery);
+	</script>
+
+	<script type="application/javascript">
+    $(function () {
+      // 获得 code 授权码
+      const code = $.getUrlParam('code');
+      if (!code) {
+        alert('获取不到 code 参数,请排查!')
+        return;
+      }
+
+      // 提交
+      const redirectUri = 'http://127.0.0.1:18080/callback.html'; // 需要修改成,你回调的地址,就是在 index.html 拼接的 redirectUri
+      $.ajax({
+        url:  "http://127.0.0.1:18080/auth/login-by-code?code=" + code
+          + '&redirectUri=' + redirectUri,
+        method: 'POST',
+        success: function( result ) {
+          if (result.code !== 0) {
+            alert('获得访问令牌失败,原因:' + result.msg)
+            return;
+          }
+          alert('获得访问令牌成功!点击确认,跳转回首页')
+
+          // 设置到 localStorage 中
+          localStorage.setItem('ACCESS-TOKEN', result.data.access_token);
+          localStorage.setItem('REFRESH-TOKEN', result.data.refresh_token);
+
+          // 跳转回首页
+          window.location.href = '/index.html';
+        }
+      })
+    })
+	</script>
+</head>
+<body>
+正在使用 code 授权码,进行 accessToken 访问令牌的获取
+</body>
+</html>

+ 159 - 0
yudao-example/yudao-sso-demo-by-code/src/main/resources/static/index.html

@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8">
+	<title>首页</title>
+	<!-- jQuery:操作 dom、发起请求等 -->
+	<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.2/jquery.min.js" type="application/javascript"></script>
+
+	<script type="application/javascript">
+
+    /**
+     * 跳转单点登录
+     */
+    function ssoLogin() {
+      const clientId = 'yudao-sso-demo-by-code'; // 可以改写成,你的 clientId
+      const redirectUri = encodeURIComponent('http://127.0.0.1:18080/callback.html'); // 注意,需要使用 encodeURIComponent 编码地址
+      const responseType = 'code'; // 1)授权码模式,对应 code;2)简化模式,对应 token
+      window.location.href = 'http://127.0.0.1:1024/sso?client_id=' + clientId
+        + '&redirect_uri=' + redirectUri
+        + '&response_type=' + responseType;
+    }
+
+    /**
+     * 修改昵称
+     */
+    function updateNickname() {
+      const nickname = prompt("请输入新的昵称", "");
+      if (!nickname) {
+        return;
+      }
+      // 更新用户的昵称
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      $.ajax({
+        url: "http://127.0.0.1:18080/user/update?nickname=" + nickname,
+        method: 'PUT',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('更新昵称失败,原因:' + result.msg)
+            return;
+          }
+          alert('更新昵称成功!');
+          $('#nicknameSpan').html(nickname);
+        }
+      });
+    }
+
+    /**
+     * 刷新令牌
+     */
+    function refreshToken() {
+      const refreshToken = localStorage.getItem('REFRESH-TOKEN');
+      if (!refreshToken) {
+        alert("获取不到刷新令牌");
+        return;
+      }
+      $.ajax({
+        url: "http://127.0.0.1:18080/auth/refresh-token?refreshToken=" + refreshToken,
+        method: 'POST',
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('刷新访问令牌失败,原因:' + result.msg)
+            return;
+          }
+          alert('更新访问令牌成功!');
+          $('#accessTokenSpan').html(result.data.access_token);
+
+          // 设置到 localStorage 中
+          localStorage.setItem('ACCESS-TOKEN', result.data.access_token);
+          localStorage.setItem('REFRESH-TOKEN', result.data.refresh_token);
+        }
+      });
+    }
+
+    /**
+     * 登出,删除访问令牌
+     */
+    function logout() {
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      if (!accessToken) {
+        location.reload();
+        return;
+      }
+      $.ajax({
+        url: "http://127.0.0.1:18080/auth/logout",
+        method: 'POST',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('退出登录失败,原因:' + result.msg)
+            return;
+          }
+          alert('退出登录成功!');
+          // 删除 localStorage 中
+          localStorage.removeItem('ACCESS-TOKEN');
+          localStorage.removeItem('REFRESH-TOKEN');
+
+          location.reload();
+        }
+      });
+    }
+
+    $(function () {
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      // 情况一:未登录
+      if (!accessToken) {
+        $('#noLoginDiv').css("display", "block");
+        return;
+      }
+
+      // 情况二:已登录
+      $('#yesLoginDiv').css("display", "block");
+      $('#accessTokenSpan').html(accessToken);
+      // 获得登录用户的信息
+      $.ajax({
+        url: "http://127.0.0.1:18080/user/get",
+        method: 'GET',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('获得个人信息失败,原因:' + result.msg)
+            return;
+          }
+          $('#nicknameSpan').html(result.data.nickname);
+        }
+      });
+    })
+	</script>
+</head>
+<body>
+<!-- 情况一:未登录:1)跳转 ruoyi-vue-pro 的 SSO 登录页 -->
+<div id="noLoginDiv" style="display: none">
+	您未登录,点击 <a href="#" onclick="ssoLogin()">跳转 </a> SSO 单点登录
+</div>
+
+<!-- 情况二:已登录:1)展示用户信息;2)刷新访问令牌;3)退出登录 -->
+<div id="yesLoginDiv" style="display: none">
+	您已登录!<button onclick="logout()">退出登录</button> <br />
+	昵称:<span id="nicknameSpan"> 加载中... </span> <button onclick="updateNickname()">修改昵称</button> <br />
+	访问令牌:<span id="accessTokenSpan"> 加载中... </span> <button onclick="refreshToken()">刷新令牌</button> <br />
+</div>
+</body>
+<style>
+    body { /** 页面居中 */
+        border-radius: 20px;
+        height: 350px;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%,-50%);
+    }
+</style>
+</html>

+ 65 - 0
yudao-example/yudao-sso-demo-by-password/pom.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- 由于方便大家拷贝,使用不使用 yudao 作为 Maven parent -->
+
+    <groupId>cn.iocoder.boot</groupId>
+    <artifactId>yudao-sso-demo-by-password</artifactId>
+    <version>1.0.0-snapshot</version>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>基于密码模式,如何实现 SSO 单点登录?</description>
+    <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
+
+    <properties>
+        <!-- Maven 相关 -->
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <!-- 统一依赖管理 -->
+        <spring.boot.version>2.7.7</spring.boot.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- 统一依赖管理 -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Web 相关 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.11</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+</project>

+ 13 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/SSODemoApplication.java

@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.ssodemo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SSODemoApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SSODemoApplication.class, args);
+    }
+
+}

+ 127 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/OAuth2Client.java

@@ -0,0 +1,127 @@
+package cn.iocoder.yudao.ssodemo.client;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2AccessTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2CheckTokenRespDTO;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
+import org.springframework.util.Base64Utils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.StandardCharsets;
+
+/**
+ * OAuth 2.0 客户端
+ *
+ * 对应调用 OAuth2OpenController 接口
+ */
+@Component
+public class OAuth2Client {
+
+    private static final String BASE_URL = "http://127.0.0.1:48080/admin-api/system/oauth2";
+
+    /**
+     * 租户编号
+     *
+     * 默认使用 1;如果使用别的租户,可以调整
+     */
+    public static final Long TENANT_ID = 1L;
+
+    private static final String CLIENT_ID = "yudao-sso-demo-by-password";
+    private static final String CLIENT_SECRET = "test";
+
+
+//    @Resource // 可优化,注册一个 RestTemplate Bean,然后注入
+    private final RestTemplate restTemplate = new RestTemplate();
+
+    /**
+     * 校验访问令牌,并返回它的基本信息
+     *
+     * @param token 访问令牌
+     * @return 访问令牌的基本信息
+     */
+    public CommonResult<OAuth2CheckTokenRespDTO> checkToken(String token) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("token", token);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<OAuth2CheckTokenRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/check-token",
+                HttpMethod.POST,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<OAuth2CheckTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    /**
+     * 使用刷新令牌,获得(刷新)访问令牌
+     *
+     * @param refreshToken 刷新令牌
+     * @return 访问令牌
+     */
+    public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(String refreshToken) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("grant_type", "refresh_token");
+        body.add("refresh_token", refreshToken);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<OAuth2AccessTokenRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/token",
+                HttpMethod.POST,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<OAuth2AccessTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    /**
+     * 删除访问令牌
+     *
+     * @param token 访问令牌
+     * @return 成功
+     */
+    public CommonResult<Boolean> revokeToken(String token) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", TENANT_ID.toString());
+        addClientHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+        body.add("token", token);
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange(
+                BASE_URL + "/token",
+                HttpMethod.DELETE,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    private static void addClientHeader(HttpHeaders headers) {
+        // client 拼接,需要 BASE64 编码
+        String client = CLIENT_ID + ":" + CLIENT_SECRET;
+        client = Base64Utils.encodeToString(client.getBytes(StandardCharsets.UTF_8));
+        headers.add("Authorization", "Basic " + client);
+    }
+
+}

+ 73 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/UserClient.java

@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.ssodemo.client;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserInfoRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserUpdateReqDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 用户 User 信息的客户端
+ *
+ * 对应调用 OAuth2UserController 接口
+ */
+@Component
+public class UserClient {
+
+    private static final String BASE_URL = "http://127.0.0.1:48080/admin-api//system/oauth2/user";
+
+    //    @Resource // 可优化,注册一个 RestTemplate Bean,然后注入
+    private final RestTemplate restTemplate = new RestTemplate();
+
+    public CommonResult<UserInfoRespDTO> getUser() {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        headers.set("tenant-id", OAuth2Client.TENANT_ID.toString());
+        addTokenHeader(headers);
+        // 1.2 构建请求参数
+        MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<UserInfoRespDTO>> exchange = restTemplate.exchange(
+                BASE_URL + "/get",
+                HttpMethod.GET,
+                new HttpEntity<>(body, headers),
+                new ParameterizedTypeReference<CommonResult<UserInfoRespDTO>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+    public CommonResult<Boolean> updateUser(UserUpdateReqDTO updateReqDTO) {
+        // 1.1 构建请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+        headers.set("tenant-id", OAuth2Client.TENANT_ID.toString());
+        addTokenHeader(headers);
+        // 1.2 构建请求参数
+        // 使用 updateReqDTO 即可
+
+        // 2. 执行请求
+        ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange(
+                BASE_URL + "/update",
+                HttpMethod.PUT,
+                new HttpEntity<>(updateReqDTO, headers),
+                new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失
+        Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功");
+        return exchange.getBody();
+    }
+
+
+    private static void addTokenHeader(HttpHeaders headers) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        Assert.notNull(loginUser, "登录用户不能为空");
+        headers.add("Authorization", "Bearer " + loginUser.getAccessToken());
+    }
+}

+ 28 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/CommonResult.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.ssodemo.client.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 通用返回
+ *
+ * @param <T> 数据泛型
+ */
+@Data
+public class CommonResult<T> implements Serializable {
+
+    /**
+     * 错误码
+     */
+    private Integer code;
+    /**
+     * 返回数据
+     */
+    private T data;
+    /**
+     * 错误提示,用户可阅读
+     */
+    private String msg;
+
+}

+ 45 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2AccessTokenRespDTO.java

@@ -0,0 +1,45 @@
+package cn.iocoder.yudao.ssodemo.client.dto.oauth2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 访问令牌 Response DTO
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class OAuth2AccessTokenRespDTO {
+
+    /**
+     * 访问令牌
+     */
+    @JsonProperty("access_token")
+    private String accessToken;
+
+    /**
+     * 刷新令牌
+     */
+    @JsonProperty("refresh_token")
+    private String refreshToken;
+
+    /**
+     * 令牌类型
+     */
+    @JsonProperty("token_type")
+    private String tokenType;
+
+    /**
+     * 过期时间;单位:秒
+     */
+    @JsonProperty("expires_in")
+    private Long expiresIn;
+
+    /**
+     * 授权范围;如果多个授权范围,使用空格分隔
+     */
+    private String scope;
+
+}

+ 59 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/oauth2/OAuth2CheckTokenRespDTO.java

@@ -0,0 +1,59 @@
+package cn.iocoder.yudao.ssodemo.client.dto.oauth2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 校验令牌 Response DTO
+ *
+ * @author 芋道源码
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class OAuth2CheckTokenRespDTO {
+
+    /**
+     * 用户编号
+     */
+    @JsonProperty("user_id")
+    private Long userId;
+    /**
+     * 用户类型
+     */
+    @JsonProperty("user_type")
+    private Integer userType;
+    /**
+     * 租户编号
+     */
+    @JsonProperty("tenant_id")
+    private Long tenantId;
+
+    /**
+     * 客户端编号
+     */
+    @JsonProperty("client_id")
+    private String clientId;
+    /**
+     * 授权范围
+     */
+    private List<String> scopes;
+
+    /**
+     * 访问令牌
+     */
+    @JsonProperty("access_token")
+    private String accessToken;
+
+    /**
+     * 过期时间
+     *
+     * 时间戳 / 1000,即单位:秒
+     */
+    private Long exp;
+
+}

+ 97 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserInfoRespDTO.java

@@ -0,0 +1,97 @@
+package cn.iocoder.yudao.ssodemo.client.dto.user;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 获得用户基本信息 Response dto
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UserInfoRespDTO {
+
+    /**
+     * 用户编号
+     */
+    private Long id;
+
+    /**
+     * 用户账号
+     */
+    private String username;
+
+    /**
+     * 用户昵称
+     */
+    private String nickname;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+    /**
+     * 手机号码
+     */
+    private String mobile;
+
+    /**
+     * 用户性别
+     */
+    private Integer sex;
+
+    /**
+     * 用户头像
+     */
+    private String avatar;
+
+    /**
+     * 所在部门
+     */
+    private Dept dept;
+
+    /**
+     * 所属岗位数组
+     */
+    private List<Post> posts;
+
+    /**
+     * 部门
+     */
+    @Data
+    public static class Dept {
+
+        /**
+         * 部门编号
+         */
+        private Long id;
+
+        /**
+         * 部门名称
+         */
+        private String name;
+
+    }
+
+    /**
+     * 岗位
+     */
+    @Data
+    public static class Post {
+
+        /**
+         * 岗位编号
+         */
+        private Long id;
+
+        /**
+         * 岗位名称
+         */
+        private String name;
+
+    }
+
+}

+ 35 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/client/dto/user/UserUpdateReqDTO.java

@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.ssodemo.client.dto.user;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 更新用户基本信息 Request DTO
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UserUpdateReqDTO {
+
+    /**
+     * 用户昵称
+     */
+    private String nickname;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 手机号码
+     */
+    private String mobile;
+
+    /**
+     * 用户性别
+     */
+    private Integer sex;
+
+}

+ 50 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/controller/AuthController.java

@@ -0,0 +1,50 @@
+package cn.iocoder.yudao.ssodemo.controller;
+
+import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.ssodemo.client.OAuth2Client;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2AccessTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping("/auth")
+public class AuthController {
+
+    @Resource
+    private OAuth2Client oauth2Client;
+
+    /**
+     * 使用刷新令牌,获得(刷新)访问令牌
+     *
+     * @param refreshToken 刷新令牌
+     * @return 访问令牌;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段
+     */
+    @PostMapping("/refresh-token")
+    public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(@RequestParam("refreshToken") String refreshToken) {
+        return oauth2Client.refreshToken(refreshToken);
+    }
+
+    /**
+     * 退出登录
+     *
+     * @param request 请求
+     * @return 成功
+     */
+    @PostMapping("/logout")
+    public CommonResult<Boolean> logout(HttpServletRequest request) {
+        String token = SecurityUtils.obtainAuthorization(request, "Authorization");
+        if (StrUtil.isNotBlank(token)) {
+            return oauth2Client.revokeToken(token);
+        }
+        // 返回成功
+        return new CommonResult<>();
+    }
+
+}

+ 40 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/controller/UserController.java

@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.ssodemo.controller;
+
+import cn.iocoder.yudao.ssodemo.client.UserClient;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserInfoRespDTO;
+import cn.iocoder.yudao.ssodemo.client.dto.user.UserUpdateReqDTO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/user")
+public class UserController {
+
+    @Resource
+    private UserClient userClient;
+
+    /**
+     * 获得当前登录用户的基本信息
+     *
+     * @return 用户信息;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段
+     */
+    @GetMapping("/get")
+    public CommonResult<UserInfoRespDTO> getUser() {
+        return userClient.getUser();
+    }
+
+    /**
+     * 更新当前登录用户的昵称
+     *
+     * @param nickname 昵称
+     * @return 成功
+     */
+    @PutMapping("/update")
+    public CommonResult<Boolean> updateUser(@RequestParam("nickname") String nickname) {
+        UserUpdateReqDTO updateReqDTO = new UserUpdateReqDTO(nickname, null, null, null);
+        return userClient.updateUser(updateReqDTO);
+    }
+
+}

+ 52 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java

@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.ssodemo.framework.config;
+
+import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
+import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.SecurityFilterChain;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+import javax.annotation.Resource;
+
+@Configuration(proxyBeanMethods = false)
+@EnableWebSecurity
+public class SecurityConfiguration {
+
+    @Resource
+    private TokenAuthenticationFilter tokenAuthenticationFilter;
+
+    @Resource
+    private AccessDeniedHandlerImpl accessDeniedHandler;
+    @Resource
+    private AuthenticationEntryPoint authenticationEntryPoint;
+
+    @Bean
+    protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
+        // 设置 URL 安全权限
+        httpSecurity.csrf().disable() // 禁用 CSRF 保护
+                .authorizeRequests()
+                // 1. 静态资源,可匿名访问
+                .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll()
+                // 2. 登录相关的接口,可匿名访问
+                .antMatchers("/auth/login-by-code").permitAll()
+                .antMatchers("/auth/refresh-token").permitAll()
+                .antMatchers("/auth/logout").permitAll()
+                // last. 兜底规则,必须认证
+                .and().authorizeRequests()
+                .anyRequest().authenticated();
+
+        // 设置处理器
+        httpSecurity.exceptionHandling().accessDeniedHandler(accessDeniedHandler)
+                .authenticationEntryPoint(authenticationEntryPoint);
+
+        // 添加 Token Filter
+        httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
+        return httpSecurity.build();
+    }
+
+}

+ 37 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/LoginUser.java

@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.ssodemo.framework.core;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 登录用户信息
+ *
+ * @author 芋道源码
+ */
+@Data
+public class LoginUser {
+
+    /**
+     * 用户编号
+     */
+    private Long id;
+    /**
+     * 用户类型
+     */
+    private Integer userType;
+    /**
+     * 租户编号
+     */
+    private Long tenantId;
+    /**
+     * 授权范围
+     */
+    private List<String> scopes;
+
+    /**
+     * 访问令牌
+     */
+    private String accessToken;
+
+}

+ 66 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/filter/TokenAuthenticationFilter.java

@@ -0,0 +1,66 @@
+package cn.iocoder.yudao.ssodemo.framework.core.filter;
+
+import cn.iocoder.yudao.ssodemo.client.OAuth2Client;
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.client.dto.oauth2.OAuth2CheckTokenRespDTO;
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.annotation.Resource;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Token 过滤器,验证 token 的有效性
+ * 验证通过后,获得 {@link LoginUser} 信息,并加入到 Spring Security 上下文
+ *
+ * @author 芋道源码
+ */
+@Component
+public class TokenAuthenticationFilter extends OncePerRequestFilter {
+
+    @Resource
+    private OAuth2Client oauth2Client;
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
+                                    FilterChain filterChain) throws ServletException, IOException {
+        // 1. 获得访问令牌
+        String token = SecurityUtils.obtainAuthorization(request, "Authorization");
+        if (StringUtils.hasText(token)) {
+            // 2. 基于 token 构建登录用户
+            LoginUser loginUser = buildLoginUserByToken(token);
+            // 3. 设置当前用户
+            if (loginUser != null) {
+                SecurityUtils.setLoginUser(loginUser, request);
+            }
+        }
+
+        // 继续过滤链
+        filterChain.doFilter(request, response);
+    }
+
+    private LoginUser buildLoginUserByToken(String token) {
+        try {
+            CommonResult<OAuth2CheckTokenRespDTO> accessTokenResult = oauth2Client.checkToken(token);
+            OAuth2CheckTokenRespDTO accessToken = accessTokenResult.getData();
+            if (accessToken == null) {
+                return null;
+            }
+            // 构建登录用户
+            return new LoginUser().setId(accessToken.getUserId()).setUserType(accessToken.getUserType())
+                    .setTenantId(accessToken.getTenantId()).setScopes(accessToken.getScopes())
+                    .setAccessToken(accessToken.getAccessToken());
+        } catch (Exception exception) {
+            // 校验 Token 不通过时,考虑到一些接口是无需登录的,所以直接返回 null 即可
+            return null;
+        }
+    }
+
+}

+ 44 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AccessDeniedHandlerImpl.java

@@ -0,0 +1,44 @@
+package cn.iocoder.yudao.ssodemo.framework.core.handler;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.framework.core.util.SecurityUtils;
+import cn.iocoder.yudao.ssodemo.framework.core.util.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.security.web.access.ExceptionTranslationFilter;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 访问一个需要认证的 URL 资源,已经认证(登录)但是没有权限的情况下,返回 {@link GlobalErrorCodeConstants#FORBIDDEN} 错误码。
+ *
+ * 补充:Spring Security 通过 {@link ExceptionTranslationFilter#handleAccessDeniedException(HttpServletRequest, HttpServletResponse, FilterChain, AccessDeniedException)} 方法,调用当前类
+ *
+ * @author 芋道源码
+ */
+@Component
+@SuppressWarnings("JavadocReference")
+@Slf4j
+public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
+
+    @Override
+    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e)
+            throws IOException, ServletException {
+        // 打印 warn 的原因是,不定期合并 warn,看看有没恶意破坏
+        log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(),
+                SecurityUtils.getLoginUserId(), e);
+        // 返回 403
+        CommonResult<Object> result = new CommonResult<>();
+        result.setCode(HttpStatus.FORBIDDEN.value());
+        result.setMsg("没有该操作权限");
+        ServletUtils.writeJSON(response, result);
+    }
+
+}

+ 36 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/handler/AuthenticationEntryPointImpl.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.ssodemo.framework.core.handler;
+
+import cn.iocoder.yudao.ssodemo.client.dto.CommonResult;
+import cn.iocoder.yudao.ssodemo.framework.core.util.ServletUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.access.ExceptionTranslationFilter;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.FilterChain;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 访问一个需要认证的 URL 资源,但是此时自己尚未认证(登录)的情况下,返回 {@link GlobalErrorCodeConstants#UNAUTHORIZED} 错误码,从而使前端重定向到登录页
+ *
+ * 补充:Spring Security 通过 {@link ExceptionTranslationFilter#sendStartAuthentication(HttpServletRequest, HttpServletResponse, FilterChain, AuthenticationException)} 方法,调用当前类
+ */
+@Component
+@Slf4j
+@SuppressWarnings("JavadocReference") // 忽略文档引用报错
+public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint {
+
+    @Override
+    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
+        log.debug("[commence][访问 URL({}) 时,没有登录]", request.getRequestURI(), e);
+        // 返回 401
+        CommonResult<Object> result = new CommonResult<>();
+        result.setCode(HttpStatus.UNAUTHORIZED.value());
+        result.setMsg("账号未登录");
+        ServletUtils.writeJSON(response, result);
+    }
+
+}

+ 103 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/SecurityUtils.java

@@ -0,0 +1,103 @@
+package cn.iocoder.yudao.ssodemo.framework.core.util;
+
+import cn.iocoder.yudao.ssodemo.framework.core.LoginUser;
+import org.springframework.lang.Nullable;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collections;
+
+/**
+ * 安全服务工具类
+ *
+ * @author 芋道源码
+ */
+public class SecurityUtils {
+
+    public static final String AUTHORIZATION_BEARER = "Bearer";
+
+    private SecurityUtils() {}
+
+    /**
+     * 从请求中,获得认证 Token
+     *
+     * @param request 请求
+     * @param header 认证 Token 对应的 Header 名字
+     * @return 认证 Token
+     */
+    public static String obtainAuthorization(HttpServletRequest request, String header) {
+        String authorization = request.getHeader(header);
+        if (!StringUtils.hasText(authorization)) {
+            return null;
+        }
+        int index = authorization.indexOf(AUTHORIZATION_BEARER + " ");
+        if (index == -1) { // 未找到
+            return null;
+        }
+        return authorization.substring(index + 7).trim();
+    }
+
+    /**
+     * 获得当前认证信息
+     *
+     * @return 认证信息
+     */
+    public static Authentication getAuthentication() {
+        SecurityContext context = SecurityContextHolder.getContext();
+        if (context == null) {
+            return null;
+        }
+        return context.getAuthentication();
+    }
+
+    /**
+     * 获取当前用户
+     *
+     * @return 当前用户
+     */
+    @Nullable
+    public static LoginUser getLoginUser() {
+        Authentication authentication = getAuthentication();
+        if (authentication == null) {
+            return null;
+        }
+        return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null;
+    }
+
+    /**
+     * 获得当前用户的编号,从上下文中
+     *
+     * @return 用户编号
+     */
+    @Nullable
+    public static Long getLoginUserId() {
+        LoginUser loginUser = getLoginUser();
+        return loginUser != null ? loginUser.getId() : null;
+    }
+
+    /**
+     * 设置当前用户
+     *
+     * @param loginUser 登录用户
+     * @param request 请求
+     */
+    public static void setLoginUser(LoginUser loginUser, HttpServletRequest request) {
+        // 创建 Authentication,并设置到上下文
+        Authentication authentication = buildAuthentication(loginUser, request);
+        SecurityContextHolder.getContext().setAuthentication(authentication);
+    }
+
+    private static Authentication buildAuthentication(LoginUser loginUser, HttpServletRequest request) {
+        // 创建 UsernamePasswordAuthenticationToken 对象
+        UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
+                loginUser, null, Collections.emptyList());
+        authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+        return authenticationToken;
+    }
+
+}

+ 28 - 0
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/core/util/ServletUtils.java

@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.ssodemo.framework.core.util;
+
+import cn.hutool.extra.servlet.ServletUtil;
+import cn.hutool.json.JSONUtil;
+import org.springframework.http.MediaType;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 客户端工具类
+ *
+ * @author 芋道源码
+ */
+public class ServletUtils {
+
+    /**
+     * 返回 JSON 字符串
+     *
+     * @param response 响应
+     * @param object 对象,会序列化成 JSON 字符串
+     */
+    @SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE,否则会乱码
+    public static void writeJSON(HttpServletResponse response, Object object) {
+        String content = JSONUtil.toJsonStr(object);
+        ServletUtil.write(response, content, MediaType.APPLICATION_JSON_UTF8_VALUE);
+    }
+
+}

+ 2 - 0
yudao-example/yudao-sso-demo-by-password/src/main/resources/application.yaml

@@ -0,0 +1,2 @@
+server:
+  port: 18080

+ 154 - 0
yudao-example/yudao-sso-demo-by-password/src/main/resources/static/index.html

@@ -0,0 +1,154 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8">
+	<title>首页</title>
+	<!-- jQuery:操作 dom、发起请求等 -->
+	<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.2/jquery.min.js" type="application/javascript"></script>
+
+	<script type="application/javascript">
+
+    /**
+     * 跳转单点登录
+     */
+    function passwordLogin() {
+      window.location.href = '/login.html'
+    }
+
+    /**
+     * 修改昵称
+     */
+    function updateNickname() {
+      const nickname = prompt("请输入新的昵称", "");
+      if (!nickname) {
+        return;
+      }
+      // 更新用户的昵称
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      $.ajax({
+        url: "http://127.0.0.1:18080/user/update?nickname=" + nickname,
+        method: 'PUT',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('更新昵称失败,原因:' + result.msg)
+            return;
+          }
+          alert('更新昵称成功!');
+          $('#nicknameSpan').html(nickname);
+        }
+      });
+    }
+
+    /**
+     * 刷新令牌
+     */
+    function refreshToken() {
+      const refreshToken = localStorage.getItem('REFRESH-TOKEN');
+      if (!refreshToken) {
+        alert("获取不到刷新令牌");
+        return;
+      }
+      $.ajax({
+        url: "http://127.0.0.1:18080/auth/refresh-token?refreshToken=" + refreshToken,
+        method: 'POST',
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('刷新访问令牌失败,原因:' + result.msg)
+            return;
+          }
+          alert('更新访问令牌成功!');
+          $('#accessTokenSpan').html(result.data.access_token);
+
+          // 设置到 localStorage 中
+          localStorage.setItem('ACCESS-TOKEN', result.data.access_token);
+          localStorage.setItem('REFRESH-TOKEN', result.data.refresh_token);
+        }
+      });
+    }
+
+    /**
+     * 登出,删除访问令牌
+     */
+    function logout() {
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      if (!accessToken) {
+        location.reload();
+        return;
+      }
+      $.ajax({
+        url: "http://127.0.0.1:18080/auth/logout",
+        method: 'POST',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('退出登录失败,原因:' + result.msg)
+            return;
+          }
+          alert('退出登录成功!');
+          // 删除 localStorage 中
+          localStorage.removeItem('ACCESS-TOKEN');
+          localStorage.removeItem('REFRESH-TOKEN');
+
+          location.reload();
+        }
+      });
+    }
+
+    $(function () {
+      const accessToken = localStorage.getItem('ACCESS-TOKEN');
+      // 情况一:未登录
+      if (!accessToken) {
+        $('#noLoginDiv').css("display", "block");
+        return;
+      }
+
+      // 情况二:已登录
+      $('#yesLoginDiv').css("display", "block");
+      $('#accessTokenSpan').html(accessToken);
+      // 获得登录用户的信息
+      $.ajax({
+        url: "http://127.0.0.1:18080/user/get",
+        method: 'GET',
+        headers: {
+          'Authorization': 'Bearer ' + accessToken
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('获得个人信息失败,原因:' + result.msg)
+            return;
+          }
+          $('#nicknameSpan').html(result.data.nickname);
+        }
+      });
+    })
+	</script>
+</head>
+<body>
+<!-- 情况一:未登录:1)跳转 ruoyi-vue-pro 的 SSO 登录页 -->
+<div id="noLoginDiv" style="display: none">
+	您未登录,点击 <a href="#" onclick="passwordLogin()">跳转 </a> 账号密码登录
+</div>
+
+<!-- 情况二:已登录:1)展示用户信息;2)刷新访问令牌;3)退出登录 -->
+<div id="yesLoginDiv" style="display: none">
+	您已登录!<button onclick="logout()">退出登录</button> <br />
+	昵称:<span id="nicknameSpan"> 加载中... </span> <button onclick="updateNickname()">修改昵称</button> <br />
+	访问令牌:<span id="accessTokenSpan"> 加载中... </span> <button onclick="refreshToken()">刷新令牌</button> <br />
+</div>
+</body>
+<style>
+    body { /** 页面居中 */
+        border-radius: 20px;
+        height: 350px;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%,-50%);
+    }
+</style>
+</html>

+ 74 - 0
yudao-example/yudao-sso-demo-by-password/src/main/resources/static/login.html

@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8">
+	<title>登录</title>
+	<!-- jQuery:操作 dom、发起请求等 -->
+	<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.1.2/jquery.min.js" type="application/javascript"></script>
+
+	<script type="application/javascript">
+
+    /**
+     * 账号密码登录
+     */
+    function login() {
+      const clientId = 'yudao-sso-demo-by-password'; // 可以改写成,你的 clientId
+      const clientSecret = 'test'; // 可以改写成,你的 clientSecret
+      const grantType = 'password'; // 密码模式
+
+      // 账号 + 密码
+      const username = $('#username').val();
+      const password = $('#password').val();
+      if (username.length === 0 || password.length === 0) {
+        alert('账号或密码未输入');
+        return;
+      }
+
+      // 发起请求
+      $.ajax({
+        url: "http://127.0.0.1:48080/admin-api/system/oauth2/token?"
+          // 客户端
+          + "client_id=" + clientId
+          + "&client_secret=" + clientSecret
+          // 密码模式的参数
+          + "&grant_type=" + grantType
+          + "&username=" + username
+          + "&password=" + password
+          + '&scope=user.read user.write',
+        method: 'POST',
+        headers: {
+          'tenant-id': '1', // 多租户编号,写死
+        },
+        success: function (result) {
+          if (result.code !== 0) {
+            alert('登录失败,原因:' + result.msg)
+            return;
+          }
+          // 设置到 localStorage 中
+          localStorage.setItem('ACCESS-TOKEN', result.data.access_token);
+          localStorage.setItem('REFRESH-TOKEN', result.data.refresh_token);
+
+          // 提示登录成功
+          alert('登录成功!点击确认,跳转回首页');
+          window.location.href = '/index.html';
+        }
+      });
+    }
+	</script>
+</head>
+<body>
+账号:<input id="username" value="admin" /> <br />
+密码:<input id="password" value="admin123" > <br />
+<button style="float: right; margin-top: 5px;" onclick="login()">登录</button>
+</body>
+<style>
+    body { /** 页面居中 */
+        border-radius: 20px;
+        height: 350px;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%,-50%);
+    }
+</style>
+</html>

+ 4 - 1
yudao-framework/pom.xml

@@ -20,7 +20,6 @@
         <module>yudao-spring-boot-starter-file</module>
         <module>yudao-spring-boot-starter-monitor</module>
         <module>yudao-spring-boot-starter-protection</module>
-        <module>yudao-spring-boot-starter-config</module>
         <module>yudao-spring-boot-starter-job</module>
         <module>yudao-spring-boot-starter-mq</module>
 
@@ -37,8 +36,12 @@
         <module>yudao-spring-boot-starter-biz-tenant</module>
         <module>yudao-spring-boot-starter-biz-data-permission</module>
         <module>yudao-spring-boot-starter-biz-error-code</module>
+        <module>yudao-spring-boot-starter-biz-ip</module>
 
         <module>yudao-spring-boot-starter-flowable</module>
+        <module>yudao-spring-boot-starter-captcha</module>
+        <module>yudao-spring-boot-starter-websocket</module>
+        <module>yudao-spring-boot-starter-desensitize</module>
     </modules>
 
     <artifactId>yudao-framework</artifactId>

+ 5 - 0
yudao-framework/yudao-common/pom.xml

@@ -105,6 +105,11 @@
             <artifactId>jackson-core</artifactId>
             <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 -->
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-jsr310</artifactId>
+            <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 -->
+        </dependency>
 
         <dependency>
             <groupId>org.slf4j</groupId>

+ 0 - 1
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/CommonStatusEnum.java

@@ -20,7 +20,6 @@ public enum CommonStatusEnum implements IntArrayValuable {
 
     public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray();
 
-
     /**
      * 状态值
      */

+ 2 - 1
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/DocumentEnum.java

@@ -12,7 +12,8 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum DocumentEnum {
 
-    REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档");
+    REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档"),
+    TENANT("https://doc.iocoder.cn", "SaaS 多租户文档");
 
     private final String url;
     private final String memo;

+ 40 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java

@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.framework.common.enums;
+
+import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import java.util.Arrays;
+
+/**
+ * 终端的枚举
+ *
+ * @author 芋道源码
+ */
+@RequiredArgsConstructor
+@Getter
+public enum TerminalEnum implements IntArrayValuable {
+
+    WECHAT_MINI_PROGRAM(10, "微信小程序"),
+    WECHAT_WAP(11, "微信公众号"),
+    H5(20, "H5 网页"),
+    IOS(31, "苹果 App"),
+    ANDROID(32, "安卓 App"),
+    ;
+
+    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();
+
+    /**
+     * 终端
+     */
+    private final Integer terminal;
+    /**
+     * 终端名
+     */
+    private final String name;
+
+    @Override
+    public int[] array() {
+        return ARRAYS;
+    }
+}

+ 1 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java

@@ -29,6 +29,7 @@ public interface GlobalErrorCodeConstants {
     // ========== 服务端错误段 ==========
 
     ErrorCode INTERNAL_SERVER_ERROR = new ErrorCode(500, "系统异常");
+    ErrorCode NOT_IMPLEMENTED = new ErrorCode(501, "功能未实现/未开启");
 
     // ========== 自定义错误段 ==========
     ErrorCode REPEATED_REQUESTS = new ErrorCode(900, "重复请求,请稍后重试"); // 重复请求

+ 2 - 1
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/ArrayUtils.java

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.framework.common.util.collection;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.IterUtil;
 import cn.hutool.core.util.ArrayUtil;
 
 import java.util.Collection;
@@ -44,7 +45,7 @@ public class ArrayUtils {
         if (CollectionUtil.isEmpty(from)) {
             return (T[]) (new Object[0]);
         }
-        return ArrayUtil.toArray(from, (Class<T>) CollectionUtil.getElementType(from.iterator()));
+        return ArrayUtil.toArray(from, (Class<T>) IterUtil.getElementType(from.iterator()));
     }
 
     public static <T> T get(T[] array, int index) {

+ 17 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/CollectionUtils.java

@@ -173,6 +173,23 @@ public class CollectionUtils {
         return valueFunc.apply(t);
     }
 
+    public static <T, V extends Comparable<? super V>> V getMinValue(List<T> from, Function<T, V> valueFunc) {
+        if (CollUtil.isEmpty(from)) {
+            return null;
+        }
+        assert from.size() > 0; // 断言,避免告警
+        T t = from.stream().min(Comparator.comparing(valueFunc)).get();
+        return valueFunc.apply(t);
+    }
+
+    public static <T, V extends Comparable<? super V>> V getSumValue(List<T> from, Function<T, V> valueFunc, BinaryOperator<V> accumulator) {
+        if (CollUtil.isEmpty(from)) {
+            return null;
+        }
+        assert from.size() > 0; // 断言,避免告警
+        return from.stream().map(valueFunc).reduce(accumulator).get();
+    }
+
     public static <T> void addIfNotNull(Collection<T> coll, T item) {
         if (item == null) {
             return;

+ 1 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/collection/SetUtils.java

@@ -11,6 +11,7 @@ import java.util.Set;
  */
 public class SetUtils {
 
+    @SafeVarargs
     public static <T> Set<T> asSet(T... objs) {
         return new HashSet<>(Arrays.asList(objs));
     }

+ 57 - 22
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java

@@ -1,8 +1,8 @@
 package cn.iocoder.yudao.framework.common.util.date;
 
-import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.LocalDateTimeUtil;
 
-import java.time.Duration;
+import java.time.*;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -25,6 +25,37 @@ public class DateUtils {
 
     public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
 
+    public static final String FORMAT_HOUR_MINUTE_SECOND = "HH:mm:ss";
+
+    /**
+     * 将 LocalDateTime 转换成 Date
+     *
+     * @param date LocalDateTime
+     * @return LocalDateTime
+     */
+    public static Date of(LocalDateTime date) {
+        // 将此日期时间与时区相结合以创建 ZonedDateTime
+        ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault());
+        // 本地时间线 LocalDateTime 到即时时间线 Instant 时间戳
+        Instant instant = zonedDateTime.toInstant();
+        // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
+        return Date.from(instant);
+    }
+
+    /**
+     * 将 Date 转换成 LocalDateTime
+     *
+     * @param date Date
+     * @return LocalDateTime
+     */
+    public static LocalDateTime of(Date date) {
+        // 转为时间戳
+        Instant instant = date.toInstant();
+        // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
+        return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
+    }
+
+    @Deprecated
     public static Date addTime(Duration duration) {
         return new Date(System.currentTimeMillis() + duration.toMillis());
     }
@@ -33,6 +64,11 @@ public class DateUtils {
         return System.currentTimeMillis() > time.getTime();
     }
 
+    public static boolean isExpired(LocalDateTime time) {
+        LocalDateTime now = LocalDateTime.now();
+        return now.isAfter(time);
+    }
+
     public static long diff(Date endTime, Date startTime) {
         return endTime.getTime() - startTime.getTime();
     }
@@ -40,9 +76,9 @@ public class DateUtils {
     /**
      * 创建指定时间
      *
-     * @param year        
-     * @param mouth       
-     * @param day         
+     * @param year  年
+     * @param mouth 月
+     * @param day   日
      * @return 指定时间
      */
     public static Date buildTime(int year, int mouth, int day) {
@@ -52,12 +88,12 @@ public class DateUtils {
     /**
      * 创建指定时间
      *
-     * @param year        
-     * @param mouth       
-     * @param day         
-     * @param hour        小时
-     * @param minute      分钟
-     * @param second      
+     * @param year   年
+     * @param mouth  月
+     * @param day    日
+     * @param hour   小时
+     * @param minute 分钟
+     * @param second 秒
      * @return 指定时间
      */
     public static Date buildTime(int year, int mouth, int day,
@@ -83,12 +119,14 @@ public class DateUtils {
         return a.compareTo(b) > 0 ? a : b;
     }
 
-    public static boolean beforeNow(Date date) {
-        return date.getTime() < System.currentTimeMillis();
-    }
-
-    public static boolean afterNow(Date date) {
-        return date.getTime() >= System.currentTimeMillis();
+    public static LocalDateTime max(LocalDateTime a, LocalDateTime b) {
+        if (a == null) {
+            return b;
+        }
+        if (b == null) {
+            return a;
+        }
+        return a.isAfter(b) ? a : b;
     }
 
     /**
@@ -128,11 +166,8 @@ public class DateUtils {
      * @param date 日期
      * @return 是否
      */
-    public static boolean isToday(Date date) {
-        if (date == null) {
-            return false;
-        }
-        return DateUtil.isSameDay(date, new Date());
+    public static boolean isToday(LocalDateTime date) {
+        return LocalDateTimeUtil.isSameDay(date, LocalDateTime.now());
     }
 
 }

+ 63 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java

@@ -0,0 +1,63 @@
+package cn.iocoder.yudao.framework.common.util.date;
+
+import cn.hutool.core.date.LocalDateTimeUtil;
+
+import java.time.Duration;
+import java.time.LocalDateTime;
+
+/**
+ * 时间工具类,用于 {@link java.time.LocalDateTime}
+ *
+ * @author 芋道源码
+ */
+public class LocalDateTimeUtils {
+
+    /**
+     * 空的 LocalDateTime 对象,主要用于 DB 唯一索引的默认值
+     */
+    public static LocalDateTime EMPTY = buildTime(1970, 1, 1);
+
+    public static LocalDateTime addTime(Duration duration) {
+        return LocalDateTime.now().plus(duration);
+    }
+
+    public static boolean beforeNow(LocalDateTime date) {
+        return date.isBefore(LocalDateTime.now());
+    }
+
+    public static boolean afterNow(LocalDateTime date) {
+        return date.isAfter(LocalDateTime.now());
+    }
+
+    /**
+     * 创建指定时间
+     *
+     * @param year  年
+     * @param mouth 月
+     * @param day   日
+     * @return 指定时间
+     */
+    public static LocalDateTime buildTime(int year, int mouth, int day) {
+        return LocalDateTime.of(year, mouth, day, 0, 0, 0);
+    }
+
+    public static LocalDateTime[] buildBetweenTime(int year1, int mouth1, int day1,
+                                                   int year2, int mouth2, int day2) {
+        return new LocalDateTime[]{buildTime(year1, mouth1, day1), buildTime(year2, mouth2, day2)};
+    }
+
+    /**
+     * 判断当前时间是否在该时间范围内
+     *
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @return 是否
+     */
+    public static boolean isBetween(LocalDateTime startTime, LocalDateTime endTime) {
+        if (startTime == null || endTime == null) {
+            return false;
+        }
+        return LocalDateTimeUtil.isIn(LocalDateTime.now(), startTime, endTime);
+    }
+
+}

+ 2 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import lombok.SneakyThrows;
 import lombok.experimental.UtilityClass;
 import lombok.extern.slf4j.Slf4j;
@@ -28,6 +29,7 @@ public class JsonUtils {
 
     static {
         objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+        objectMapper.registerModules(new JavaTimeModule()); // 解决 LocalDateTime 的序列化
     }
 
     /**

+ 2 - 2
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/object/ObjectUtils.java

@@ -1,12 +1,10 @@
 package cn.iocoder.yudao.framework.common.util.object;
 
-import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ReflectUtil;
 
 import java.lang.reflect.Field;
 import java.util.Arrays;
-import java.util.Objects;
 import java.util.function.Consumer;
 
 /**
@@ -47,6 +45,7 @@ public class ObjectUtils {
         return obj1.compareTo(obj2) > 0 ? obj1 : obj2;
     }
 
+    @SafeVarargs
     public static <T> T defaultIfNull(T... array) {
         for (T item : array) {
             if (item != null) {
@@ -56,6 +55,7 @@ public class ObjectUtils {
         return null;
     }
 
+    @SafeVarargs
     public static <T> boolean equalsAny(T obj, T... array) {
         return Arrays.asList(array).contains(obj);
     }

+ 8 - 0
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/string/StrUtils.java

@@ -3,7 +3,10 @@ package cn.iocoder.yudao.framework.common.util.string;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.StrUtil;
 
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 字符串工具类
@@ -37,4 +40,9 @@ public class StrUtils {
         return false;
     }
 
+    public static List<Long> splitToLong(String value,  CharSequence separator) {
+        long[] longs = StrUtil.splitToLong(value, separator);
+        return Arrays.stream(longs).boxed().collect(Collectors.toList());
+    }
+
 }

+ 4 - 6
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/validation/ValidationUtils.java

@@ -1,7 +1,6 @@
 package cn.iocoder.yudao.framework.common.util.validation;
 
 import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.util.StrUtil;
 import org.springframework.util.StringUtils;
 
 import javax.validation.ConstraintViolation;
@@ -17,16 +16,15 @@ import java.util.regex.Pattern;
  */
 public class ValidationUtils {
 
+    private static final Pattern PATTERN_MOBILE = Pattern.compile("^(?:(?:\\+|00)86)?1(?:(?:3[\\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\\d])|(?:9[189]))\\d{8}$");
+
     private static final Pattern PATTERN_URL = Pattern.compile("^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]");
 
     private static final Pattern PATTERN_XML_NCNAME = Pattern.compile("[a-zA-Z_][\\-_.0-9_a-zA-Z$]*");
 
     public static boolean isMobile(String mobile) {
-        if (StrUtil.length(mobile) != 11) {
-            return false;
-        }
-        // TODO 芋艿,后面完善手机校验
-        return true;
+        return StringUtils.hasText(mobile)
+                && PATTERN_MOBILE.matcher(mobile).matches();
     }
 
     public static boolean isURL(String url) {

+ 2 - 2
yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java

@@ -1,15 +1,15 @@
 package cn.iocoder.yudao.framework.banner.config;
 
 import cn.iocoder.yudao.framework.banner.core.BannerApplicationRunner;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
 
 /**
  * Banner 的自动配置类
  *
  * @author 芋道源码
  */
-@Configuration
+@AutoConfiguration
 public class YudaoBannerAutoConfiguration {
 
     @Bean

+ 0 - 2
yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring.factories

@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  cn.iocoder.yudao.framework.banner.config.YudaoBannerAutoConfiguration

+ 1 - 0
yudao-framework/yudao-spring-boot-starter-banner/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+cn.iocoder.yudao.framework.banner.config.YudaoBannerAutoConfiguration

+ 3 - 4
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java

@@ -7,8 +7,8 @@ import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRuleFac
 import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRuleFactoryImpl;
 import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
 import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
 
 import java.util.List;
 
@@ -17,7 +17,7 @@ import java.util.List;
  *
  * @author 芋道源码
  */
-@Configuration
+@AutoConfiguration
 public class YudaoDataPermissionAutoConfiguration {
 
     @Bean
@@ -27,9 +27,8 @@ public class YudaoDataPermissionAutoConfiguration {
 
     @Bean
     public DataPermissionDatabaseInterceptor dataPermissionDatabaseInterceptor(MybatisPlusInterceptor interceptor,
-                                                                               List<DataPermissionRule> rules) {
+                                                                               DataPermissionRuleFactory ruleFactory) {
         // 创建 DataPermissionDatabaseInterceptor 拦截器
-        DataPermissionRuleFactory ruleFactory = dataPermissionRuleFactory(rules);
         DataPermissionDatabaseInterceptor inner = new DataPermissionDatabaseInterceptor(ruleFactory);
         // 添加到 interceptor 中
         // 需要加在首个,主要是为了在分页插件前面。这个是 MyBatis Plus 的规定

+ 2 - 2
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java

@@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissi
 import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
 import cn.iocoder.yudao.framework.security.core.LoginUser;
 import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
 
 import java.util.List;
 
@@ -16,7 +16,7 @@ import java.util.List;
  *
  * @author 芋道源码
  */
-@Configuration
+@AutoConfiguration
 @ConditionalOnClass(LoginUser.class)
 @ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class})
 public class YudaoDeptDataPermissionAutoConfiguration {

+ 211 - 80
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java

@@ -18,7 +18,6 @@ import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
 import net.sf.jsqlparser.expression.operators.relational.ExistsExpression;
 import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
 import net.sf.jsqlparser.expression.operators.relational.InExpression;
-import net.sf.jsqlparser.expression.operators.relational.ItemsList;
 import net.sf.jsqlparser.schema.Table;
 import net.sf.jsqlparser.statement.delete.Delete;
 import net.sf.jsqlparser.statement.select.*;
@@ -37,7 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * 数据权限拦截器,通过 {@link DataPermissionRule} 数据权限规则,重写 SQL 的方式来实现
- * 主要的 SQL 重写方法,可见 {@link #builderExpression(Expression, Table)} 方法
+ * 主要的 SQL 重写方法,可见 {@link #builderExpression(Expression, List)} 方法
  *
  * 整体的代码实现上,参考 {@link com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor} 实现。
  * 所以每次 MyBatis Plus 升级时,需要 Review 下其具体的实现是否有变更!
@@ -53,8 +52,7 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
     private final MappedStatementCache mappedStatementCache = new MappedStatementCache();
 
     @Override // SELECT 场景
-    public void beforeQuery(Executor executor, MappedStatement ms, Object parameter,
-                            RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) {
+    public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) {
         // 获得 Mapper 对应的数据权限的规则
         List<DataPermissionRule> rules = ruleFactory.getDataPermissionRule(ms.getId());
         if (mappedStatementCache.noRewritable(ms, rules)) { // 如果无需重写,则跳过
@@ -68,12 +66,14 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
             // 处理 SQL
             mpBs.sql(parserSingle(mpBs.sql(), null));
         } finally {
+            // 添加是否需要重写的缓存
             addMappedStatementCache(ms);
+            // 清空上下文
             ContextHolder.clear();
         }
     }
 
-    @Override // 只处理 UPDATE / DELETE 场景,不处理 INSERT 场景
+    @Override // 只处理 UPDATE / DELETE 场景,不处理 INSERT 场景(因为 INSERT 不需要数据权限)
     public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) {
         PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh);
         MappedStatement ms = mpSh.mappedStatement();
@@ -92,7 +92,9 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
                 // 处理 SQL
                 mpBs.sql(parserMulti(mpBs.sql(), null));
             } finally {
+                // 添加是否需要重写的缓存
                 addMappedStatementCache(ms);
+                // 清空上下文
                 ContextHolder.clear();
             }
         }
@@ -107,24 +109,6 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
         }
     }
 
-    protected void processSelectBody(SelectBody selectBody) {
-        if (selectBody == null) {
-            return;
-        }
-        if (selectBody instanceof PlainSelect) {
-            processPlainSelect((PlainSelect) selectBody);
-        } else if (selectBody instanceof WithItem) {
-            WithItem withItem = (WithItem) selectBody;
-            processSelectBody(withItem.getSubSelect().getSelectBody());
-        } else {
-            SetOperationList operationList = (SetOperationList) selectBody;
-            List<SelectBody> selectBodys = operationList.getSelects();
-            if (CollectionUtils.isNotEmpty(selectBodys)) {
-                selectBodys.forEach(this::processSelectBody);
-            }
-        }
-    }
-
     /**
      * update 语句处理
      */
@@ -142,28 +126,77 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
         delete.setWhere(this.builderExpression(delete.getWhere(), delete.getTable()));
     }
 
+    // ========== 和 TenantLineInnerInterceptor 一致的逻辑 ==========
+
+    protected void processSelectBody(SelectBody selectBody) {
+        if (selectBody == null) {
+            return;
+        }
+        if (selectBody instanceof PlainSelect) {
+            processPlainSelect((PlainSelect) selectBody);
+        } else if (selectBody instanceof WithItem) {
+            WithItem withItem = (WithItem) selectBody;
+            processSelectBody(withItem.getSubSelect().getSelectBody());
+        } else {
+            SetOperationList operationList = (SetOperationList) selectBody;
+            List<SelectBody> selectBodyList = operationList.getSelects();
+            if (CollectionUtils.isNotEmpty(selectBodyList)) {
+                selectBodyList.forEach(this::processSelectBody);
+            }
+        }
+    }
+
     /**
      * 处理 PlainSelect
      */
     protected void processPlainSelect(PlainSelect plainSelect) {
-        FromItem fromItem = plainSelect.getFromItem();
-        Expression where = plainSelect.getWhere();
-        processWhereSubSelect(where);
-        if (fromItem instanceof Table) {
-            Table fromTable = (Table) fromItem;
-            plainSelect.setWhere(builderExpression(where, fromTable));
-        } else {
-            processFromItem(fromItem);
-        }
         //#3087 github
         List<SelectItem> selectItems = plainSelect.getSelectItems();
         if (CollectionUtils.isNotEmpty(selectItems)) {
             selectItems.forEach(this::processSelectItem);
         }
+
+        // 处理 where 中的子查询
+        Expression where = plainSelect.getWhere();
+        processWhereSubSelect(where);
+
+        // 处理 fromItem
+        FromItem fromItem = plainSelect.getFromItem();
+        List<Table> list = processFromItem(fromItem);
+        List<Table> mainTables = new ArrayList<>(list);
+
+        // 处理 join
         List<Join> joins = plainSelect.getJoins();
         if (CollectionUtils.isNotEmpty(joins)) {
-            processJoins(joins);
+            mainTables = processJoins(mainTables, joins);
+        }
+
+        // 当有 mainTable 时,进行 where 条件追加
+        if (CollectionUtils.isNotEmpty(mainTables)) {
+            plainSelect.setWhere(builderExpression(where, mainTables));
+        }
+    }
+
+    private List<Table> processFromItem(FromItem fromItem) {
+        // 处理括号括起来的表达式
+        while (fromItem instanceof ParenthesisFromItem) {
+            fromItem = ((ParenthesisFromItem) fromItem).getFromItem();
+        }
+
+        List<Table> mainTables = new ArrayList<>();
+        // 无 join 时的处理逻辑
+        if (fromItem instanceof Table) {
+            Table fromTable = (Table) fromItem;
+            mainTables.add(fromTable);
+        } else if (fromItem instanceof SubJoin) {
+            // SubJoin 类型则还需要添加上 where 条件
+            List<Table> tables = processSubJoin((SubJoin) fromItem);
+            mainTables.addAll(tables);
+        } else {
+            // 处理下 fromItem
+            processOtherFromItem(fromItem);
         }
+        return mainTables;
     }
 
     /**
@@ -191,7 +224,7 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
             return;
         }
         if (where instanceof FromItem) {
-            processFromItem((FromItem) where);
+            processOtherFromItem((FromItem) where);
             return;
         }
         if (where.toString().indexOf("SELECT") > 0) {
@@ -204,9 +237,9 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
             } else if (where instanceof InExpression) {
                 // in
                 InExpression expression = (InExpression) where;
-                ItemsList itemsList = expression.getRightItemsList();
-                if (itemsList instanceof SubSelect) {
-                    processSelectBody(((SubSelect) itemsList).getSelectBody());
+                Expression inExpression = expression.getRightExpression();
+                if (inExpression instanceof SubSelect) {
+                    processSelectBody(((SubSelect) inExpression).getSelectBody());
                 }
             } else if (where instanceof ExistsExpression) {
                 // exists
@@ -239,7 +272,7 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
      * <p>支持: 1. select fun(args..) 2. select fun1(fun2(args..),args..)<p>
      * <p> fixed gitee pulls/141</p>
      *
-     * @param function 函数
+     * @param function
      */
     protected void processFunction(Function function) {
         ExpressionList parameters = function.getParameters();
@@ -257,22 +290,19 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
     /**
      * 处理子查询等
      */
-    protected void processFromItem(FromItem fromItem) {
-        if (fromItem instanceof SubJoin) {
-            SubJoin subJoin = (SubJoin) fromItem;
-            if (subJoin.getJoinList() != null) {
-                processJoins(subJoin.getJoinList());
-            }
-            if (subJoin.getLeft() != null) {
-                processFromItem(subJoin.getLeft());
-            }
-        } else if (fromItem instanceof SubSelect) {
+    protected void processOtherFromItem(FromItem fromItem) {
+        // 去除括号
+        while (fromItem instanceof ParenthesisFromItem) {
+            fromItem = ((ParenthesisFromItem) fromItem).getFromItem();
+        }
+
+        if (fromItem instanceof SubSelect) {
             SubSelect subSelect = (SubSelect) fromItem;
             if (subSelect.getSelectBody() != null) {
                 processSelectBody(subSelect.getSelectBody());
             }
         } else if (fromItem instanceof ValuesList) {
-            logger.debug("Perform a subquery, if you do not give us feedback");
+            logger.debug("Perform a subQuery, if you do not give us feedback");
         } else if (fromItem instanceof LateralSubSelect) {
             LateralSubSelect lateralSubSelect = (LateralSubSelect) fromItem;
             if (lateralSubSelect.getSubSelect() != null) {
@@ -284,75 +314,176 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
         }
     }
 
+    /**
+     * 处理 sub join
+     *
+     * @param subJoin subJoin
+     * @return Table subJoin 中的主表
+     */
+    private List<Table> processSubJoin(SubJoin subJoin) {
+        List<Table> mainTables = new ArrayList<>();
+        if (subJoin.getJoinList() != null) {
+            List<Table> list = processFromItem(subJoin.getLeft());
+            mainTables.addAll(list);
+            mainTables = processJoins(mainTables, subJoin.getJoinList());
+        }
+        return mainTables;
+    }
+
     /**
      * 处理 joins
      *
-     * @param joins join 集合
+     * @param mainTables 可以为 null
+     * @param joins      join 集合
+     * @return List<Table> 右连接查询的 Table 列表
      */
-    private void processJoins(List<Join> joins) {
+    private List<Table> processJoins(List<Table> mainTables, List<Join> joins) {
+        // join 表达式中最终的主表
+        Table mainTable = null;
+        // 当前 join 的左表
+        Table leftTable = null;
+
+        if (mainTables == null) {
+            mainTables = new ArrayList<>();
+        } else if (mainTables.size() == 1) {
+            mainTable = mainTables.get(0);
+            leftTable = mainTable;
+        }
+
         //对于 on 表达式写在最后的 join,需要记录下前面多个 on 的表名
-        Deque<Table> tables = new LinkedList<>();
+        Deque<List<Table>> onTableDeque = new LinkedList<>();
         for (Join join : joins) {
             // 处理 on 表达式
-            FromItem fromItem = join.getRightItem();
-            if (fromItem instanceof Table) {
-                Table fromTable = (Table) fromItem;
+            FromItem joinItem = join.getRightItem();
+
+            // 获取当前 join 的表,subJoint 可以看作是一张表
+            List<Table> joinTables = null;
+            if (joinItem instanceof Table) {
+                joinTables = new ArrayList<>();
+                joinTables.add((Table) joinItem);
+            } else if (joinItem instanceof SubJoin) {
+                joinTables = processSubJoin((SubJoin) joinItem);
+            }
+
+            if (joinTables != null) {
+
+                // 如果是隐式内连接
+                if (join.isSimple()) {
+                    mainTables.addAll(joinTables);
+                    continue;
+                }
+
+                // 当前表是否忽略
+                Table joinTable = joinTables.get(0);
+
+                List<Table> onTables = null;
+                // 如果不要忽略,且是右连接,则记录下当前表
+                if (join.isRight()) {
+                    mainTable = joinTable;
+                    if (leftTable != null) {
+                        onTables = Collections.singletonList(leftTable);
+                    }
+                } else if (join.isLeft()) {
+                    onTables = Collections.singletonList(joinTable);
+                } else if (join.isInner()) {
+                    if (mainTable == null) {
+                        onTables = Collections.singletonList(joinTable);
+                    } else {
+                        onTables = Arrays.asList(mainTable, joinTable);
+                    }
+                    mainTable = null;
+                }
+
+                mainTables = new ArrayList<>();
+                if (mainTable != null) {
+                    mainTables.add(mainTable);
+                }
+
                 // 获取 join 尾缀的 on 表达式列表
                 Collection<Expression> originOnExpressions = join.getOnExpressions();
                 // 正常 join on 表达式只有一个,立刻处理
-                if (originOnExpressions.size() == 1) {
-                    processJoin(join);
+                if (originOnExpressions.size() == 1 && onTables != null) {
+                    List<Expression> onExpressions = new LinkedList<>();
+                    onExpressions.add(builderExpression(originOnExpressions.iterator().next(), onTables));
+                    join.setOnExpressions(onExpressions);
+                    leftTable = joinTable;
                     continue;
                 }
-                tables.push(fromTable);
+                // 表名压栈,忽略的表压入 null,以便后续不处理
+                onTableDeque.push(onTables);
                 // 尾缀多个 on 表达式的时候统一处理
                 if (originOnExpressions.size() > 1) {
                     Collection<Expression> onExpressions = new LinkedList<>();
                     for (Expression originOnExpression : originOnExpressions) {
-                        Table currentTable = tables.poll();
-                        onExpressions.add(builderExpression(originOnExpression, currentTable));
+                        List<Table> currentTableList = onTableDeque.poll();
+                        if (CollectionUtils.isEmpty(currentTableList)) {
+                            onExpressions.add(originOnExpression);
+                        } else {
+                            onExpressions.add(builderExpression(originOnExpression, currentTableList));
+                        }
                     }
                     join.setOnExpressions(onExpressions);
                 }
+                leftTable = joinTable;
             } else {
-                // 处理右边连接的子表达式
-                processFromItem(fromItem);
+                processOtherFromItem(joinItem);
+                leftTable = null;
             }
         }
+
+        return mainTables;
     }
 
+    // ========== 和 TenantLineInnerInterceptor 存在差异的逻辑:关键,实现权限条件的拼接 ==========
+
     /**
-     * 处理联接语句
+     * 处理条件
+     *
+     * @param currentExpression 当前 where 条件
+     * @param table             单个表
      */
-    protected void processJoin(Join join) {
-        if (join.getRightItem() instanceof Table) {
-            Table fromTable = (Table) join.getRightItem();
-            Expression originOnExpression = CollUtil.getFirst(join.getOnExpressions());
-            originOnExpression = builderExpression(originOnExpression, fromTable);
-            join.setOnExpressions(CollUtil.newArrayList(originOnExpression));
-        }
+    protected Expression builderExpression(Expression currentExpression, Table table) {
+        return this.builderExpression(currentExpression, Collections.singletonList(table));
     }
 
     /**
      * 处理条件
+     *
+     * @param currentExpression 当前 where 条件
+     * @param tables 多个表
      */
-    protected Expression builderExpression(Expression currentExpression, Table table) {
-        // 获得 Table 对应的数据权限条件
-        Expression equalsTo = buildDataPermissionExpression(table);
-        if (equalsTo == null) { // 如果没条件,则返回 currentExpression 默认
+    protected Expression builderExpression(Expression currentExpression, List<Table> tables) {
+        // 没有表需要处理直接返回
+        if (CollectionUtils.isEmpty(tables)) {
             return currentExpression;
         }
 
-        // 表达式为空,则直接返回 equalsTo
+        // 第一步,获得 Table 对应的数据权限条件
+        Expression dataPermissionExpression = null;
+        for (Table table : tables) {
+            // 构建每个表的权限 Expression 条件
+            Expression expression = buildDataPermissionExpression(table);
+            if (expression == null) {
+                continue;
+            }
+            // 合并到 dataPermissionExpression 中
+            dataPermissionExpression = dataPermissionExpression == null ? expression
+                    : new AndExpression(dataPermissionExpression, expression);
+        }
+
+        // 第二步,合并多个 Expression 条件
+        if (dataPermissionExpression == null) {
+            return currentExpression;
+        }
         if (currentExpression == null) {
-            return equalsTo;
+            return dataPermissionExpression;
         }
-        // 如果表达式为 Or,则需要 (currentExpression) AND equalsTo
+        // 如果表达式为 Or,则需要 (currentExpression) AND dataPermissionExpression
         if (currentExpression instanceof OrExpression) {
-            return new AndExpression(new Parenthesis(currentExpression), equalsTo);
+            return new AndExpression(new Parenthesis(currentExpression), dataPermissionExpression);
         }
-        // 如果表达式为 And,则直接返回 currentExpression AND equalsTo
-        return new AndExpression(currentExpression, equalsTo);
+        // ② 如果表达式为 And,则直接返回 where AND dataPermissionExpression
+        return new AndExpression(currentExpression, dataPermissionExpression);
     }
 
     /**

+ 3 - 3
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java

@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
 import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
+import cn.iocoder.yudao.framework.expression.OrExpressionX;
 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
 import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
 import cn.iocoder.yudao.framework.security.core.LoginUser;
@@ -20,7 +21,6 @@ import net.sf.jsqlparser.expression.Alias;
 import net.sf.jsqlparser.expression.Expression;
 import net.sf.jsqlparser.expression.LongValue;
 import net.sf.jsqlparser.expression.NullValue;
-import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
 import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
 import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
 import net.sf.jsqlparser.expression.operators.relational.InExpression;
@@ -143,8 +143,8 @@ public class DeptDataPermissionRule implements DataPermissionRule {
         if (userExpression == null) {
             return deptExpression;
         }
-        // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE dept_id IN ? OR user_id = ?
-        return new OrExpression(deptExpression, userExpression);
+        // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?)
+        return new OrExpressionX(deptExpression, userExpression);
     }
 
     private Expression buildDeptExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {

+ 0 - 3
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/resources/META-INF/spring.factories

@@ -1,3 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  cn.iocoder.yudao.framework.datapermission.config.YudaoDataPermissionAutoConfiguration,\
-  cn.iocoder.yudao.framework.datapermission.config.YudaoDeptDataPermissionAutoConfiguration

+ 2 - 0
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1,2 @@
+cn.iocoder.yudao.framework.datapermission.config.YudaoDataPermissionAutoConfiguration
+cn.iocoder.yudao.framework.datapermission.config.YudaoDeptDataPermissionAutoConfiguration

+ 1 - 1
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java

@@ -87,7 +87,7 @@ public class DataPermissionDatabaseInterceptorTest extends BaseMockitoUnitTest {
             interceptor.beforeQuery(null, mappedStatement, null, null, null, boundSql);
             // 断言
             verify(mpBs, times(1)).sql(
-                    eq("SELECT * FROM t_user WHERE id = 1 AND dept_id = 100"));
+                    eq("SELECT * FROM t_user WHERE id = 1 AND t_user.dept_id = 100"));
             // 断言缓存
             assertTrue(interceptor.getMappedStatementCache().getNoRewritableMappedStatements().isEmpty());
         }

+ 205 - 42
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest2.java

@@ -46,7 +46,7 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
 
             @Override
             public Set<String> getTableNames() {
-                return asSet("entity", "entity1", "entity2", "t1", "t2", // 支持 MyBatis Plus 的单元测试
+                return asSet("entity", "entity1", "entity2", "entity3", "t1", "t2", "sys_dict_item", // 支持 MyBatis Plus 的单元测试
                         "t_user", "t_role"); // 满足自己的单元测试
             }
 
@@ -84,30 +84,30 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
     @Test
     void delete() {
         assertSql("delete from entity where id = ?",
-                "DELETE FROM entity WHERE id = ? AND tenant_id = 1");
+                "DELETE FROM entity WHERE id = ? AND entity.tenant_id = 1");
     }
 
     @Test
     void update() {
         assertSql("update entity set name = ? where id = ?",
-                "UPDATE entity SET name = ? WHERE id = ? AND tenant_id = 1");
+                "UPDATE entity SET name = ? WHERE id = ? AND entity.tenant_id = 1");
     }
 
     @Test
     void selectSingle() {
         // 单表
         assertSql("select * from entity where id = ?",
-                "SELECT * FROM entity WHERE id = ? AND tenant_id = 1");
+                "SELECT * FROM entity WHERE id = ? AND entity.tenant_id = 1");
 
         assertSql("select * from entity where id = ? or name = ?",
-                "SELECT * FROM entity WHERE (id = ? OR name = ?) AND tenant_id = 1");
+                "SELECT * FROM entity WHERE (id = ? OR name = ?) AND entity.tenant_id = 1");
 
         assertSql("SELECT * FROM entity WHERE (id = ? OR name = ?)",
-                "SELECT * FROM entity WHERE (id = ? OR name = ?) AND tenant_id = 1");
+                "SELECT * FROM entity WHERE (id = ? OR name = ?) AND entity.tenant_id = 1");
 
         /* not */
         assertSql("SELECT * FROM entity WHERE not (id = ? OR name = ?)",
-                "SELECT * FROM entity WHERE NOT (id = ? OR name = ?) AND tenant_id = 1");
+                "SELECT * FROM entity WHERE NOT (id = ? OR name = ?) AND entity.tenant_id = 1");
     }
 
     @Test
@@ -167,10 +167,12 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
         assertSql("SELECT * FROM entity e WHERE e.id >= (select e1.id from entity1 e1 where e1.id = ?)",
                 "SELECT * FROM entity e WHERE e.id >= (SELECT e1.id FROM entity1 e1 WHERE e1.id = ? AND e1.tenant_id = 1) AND e.tenant_id = 1");
 
+
         /* <= */
         assertSql("SELECT * FROM entity e WHERE e.id <= (select e1.id from entity1 e1 where e1.id = ?)",
                 "SELECT * FROM entity e WHERE e.id <= (SELECT e1.id FROM entity1 e1 WHERE e1.id = ? AND e1.tenant_id = 1) AND e.tenant_id = 1");
 
+
         /* <> */
         assertSql("SELECT * FROM entity e WHERE e.id <> (select e1.id from entity1 e1 where e1.id = ?)",
                 "SELECT * FROM entity e WHERE e.id <> (SELECT e1.id FROM entity1 e1 WHERE e1.id = ? AND e1.tenant_id = 1) AND e.tenant_id = 1");
@@ -204,6 +206,14 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
                 "SELECT * FROM entity e " +
                         "LEFT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
                         "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
+
+        assertSql("SELECT * FROM entity e " +
+                        "left join entity1 e1 on e1.id = e.id " +
+                        "left join entity2 e2 on e1.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "LEFT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
+                        "LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1 " +
+                        "WHERE e.tenant_id = 1");
     }
 
     @Test
@@ -212,17 +222,125 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
         assertSql("SELECT * FROM entity e " +
                         "right join entity1 e1 on e1.id = e.id",
                 "SELECT * FROM entity e " +
-                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE e.tenant_id = 1");
+                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 " +
+                        "WHERE e1.tenant_id = 1");
+
+        assertSql("SELECT * FROM with_as_1 e " +
+                        "right join entity1 e1 on e1.id = e.id",
+                "SELECT * FROM with_as_1 e " +
+                        "RIGHT JOIN entity1 e1 ON e1.id = e.id " +
+                        "WHERE e1.tenant_id = 1");
 
         assertSql("SELECT * FROM entity e " +
                         "right join entity1 e1 on e1.id = e.id " +
                         "WHERE e.id = ? OR e.name = ?",
                 "SELECT * FROM entity e " +
-                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
+                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 " +
+                        "WHERE (e.id = ? OR e.name = ?) AND e1.tenant_id = 1");
+
+        assertSql("SELECT * FROM entity e " +
+                        "right join entity1 e1 on e1.id = e.id " +
+                        "right join entity2 e2 on e1.id = e2.id ",
+                "SELECT * FROM entity e " +
+                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 " +
+                        "RIGHT JOIN entity2 e2 ON e1.id = e2.id AND e1.tenant_id = 1 " +
+                        "WHERE e2.tenant_id = 1");
+    }
+
+    @Test
+    void selectMixJoin() {
+        assertSql("SELECT * FROM entity e " +
+                        "right join entity1 e1 on e1.id = e.id " +
+                        "left join entity2 e2 on e1.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "RIGHT JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 " +
+                        "LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1 " +
+                        "WHERE e1.tenant_id = 1");
+
+        assertSql("SELECT * FROM entity e " +
+                        "left join entity1 e1 on e1.id = e.id " +
+                        "right join entity2 e2 on e1.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "LEFT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
+                        "RIGHT JOIN entity2 e2 ON e1.id = e2.id AND e1.tenant_id = 1 " +
+                        "WHERE e2.tenant_id = 1");
+
+        assertSql("SELECT * FROM entity e " +
+                        "left join entity1 e1 on e1.id = e.id " +
+                        "inner join entity2 e2 on e1.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "LEFT JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
+                        "INNER JOIN entity2 e2 ON e1.id = e2.id AND e.tenant_id = 1 AND e2.tenant_id = 1");
     }
 
+
+    @Test
+    void selectJoinSubSelect() {
+        assertSql("select * from (select * from entity) e1 " +
+                        "left join entity2 e2 on e1.id = e2.id",
+                "SELECT * FROM (SELECT * FROM entity WHERE entity.tenant_id = 1) e1 " +
+                        "LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1");
+
+        assertSql("select * from entity1 e1 " +
+                        "left join (select * from entity2) e2 " +
+                        "on e1.id = e2.id",
+                "SELECT * FROM entity1 e1 " +
+                        "LEFT JOIN (SELECT * FROM entity2 WHERE entity2.tenant_id = 1) e2 " +
+                        "ON e1.id = e2.id " +
+                        "WHERE e1.tenant_id = 1");
+    }
+
+    @Test
+    void selectSubJoin() {
+
+        assertSql("select * FROM " +
+                        "(entity1 e1 right JOIN entity2 e2 ON e1.id = e2.id)",
+                "SELECT * FROM " +
+                        "(entity1 e1 RIGHT JOIN entity2 e2 ON e1.id = e2.id AND e1.tenant_id = 1) " +
+                        "WHERE e2.tenant_id = 1");
+
+        assertSql("select * FROM " +
+                        "(entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id)",
+                "SELECT * FROM " +
+                        "(entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1) " +
+                        "WHERE e1.tenant_id = 1");
+
+
+        assertSql("select * FROM " +
+                        "(entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id) " +
+                        "right join entity3 e3 on e1.id = e3.id",
+                "SELECT * FROM " +
+                        "(entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1) " +
+                        "RIGHT JOIN entity3 e3 ON e1.id = e3.id AND e1.tenant_id = 1 " +
+                        "WHERE e3.tenant_id = 1");
+
+
+        assertSql("select * FROM entity e " +
+                        "LEFT JOIN (entity1 e1 right join entity2 e2 ON e1.id = e2.id) " +
+                        "on e.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "LEFT JOIN (entity1 e1 RIGHT JOIN entity2 e2 ON e1.id = e2.id AND e1.tenant_id = 1) " +
+                        "ON e.id = e2.id AND e2.tenant_id = 1 " +
+                        "WHERE e.tenant_id = 1");
+
+        assertSql("select * FROM entity e " +
+                        "LEFT JOIN (entity1 e1 left join entity2 e2 ON e1.id = e2.id) " +
+                        "on e.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "LEFT JOIN (entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1) " +
+                        "ON e.id = e2.id AND e1.tenant_id = 1 " +
+                        "WHERE e.tenant_id = 1");
+
+        assertSql("select * FROM entity e " +
+                        "RIGHT JOIN (entity1 e1 left join entity2 e2 ON e1.id = e2.id) " +
+                        "on e.id = e2.id",
+                "SELECT * FROM entity e " +
+                        "RIGHT JOIN (entity1 e1 LEFT JOIN entity2 e2 ON e1.id = e2.id AND e2.tenant_id = 1) " +
+                        "ON e.id = e2.id AND e.tenant_id = 1 " +
+                        "WHERE e1.tenant_id = 1");
+    }
+
+
     @Test
     void selectLeftJoinMultipleTrailingOn() {
         // 多个 on 尾缀的
@@ -256,51 +374,97 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
                         "inner join entity1 e1 on e1.id = e.id " +
                         "WHERE e.id = ? OR e.name = ?",
                 "SELECT * FROM entity e " +
-                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
+                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 AND e1.tenant_id = 1 " +
+                        "WHERE e.id = ? OR e.name = ?");
 
         assertSql("SELECT * FROM entity e " +
                         "inner join entity1 e1 on e1.id = e.id " +
                         "WHERE (e.id = ? OR e.name = ?)",
                 "SELECT * FROM entity e " +
-                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
+                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 AND e1.tenant_id = 1 " +
+                        "WHERE (e.id = ? OR e.name = ?)");
+
+        // 隐式内连接
+        assertSql("SELECT * FROM entity,entity1 " +
+                        "WHERE entity.id = entity1.id",
+                "SELECT * FROM entity, entity1 " +
+                        "WHERE entity.id = entity1.id AND entity.tenant_id = 1 AND entity1.tenant_id = 1");
+
+        // 隐式内连接
+        assertSql("SELECT * FROM entity a, with_as_entity1 b " +
+                        "WHERE a.id = b.id",
+                "SELECT * FROM entity a, with_as_entity1 b " +
+                        "WHERE a.id = b.id AND a.tenant_id = 1");
+
+        assertSql("SELECT * FROM with_as_entity a, with_as_entity1 b " +
+                        "WHERE a.id = b.id",
+                "SELECT * FROM with_as_entity a, with_as_entity1 b " +
+                        "WHERE a.id = b.id");
+
+        // SubJoin with 隐式内连接
+        assertSql("SELECT * FROM (entity,entity1) " +
+                        "WHERE entity.id = entity1.id",
+                "SELECT * FROM (entity, entity1) " +
+                        "WHERE entity.id = entity1.id " +
+                        "AND entity.tenant_id = 1 AND entity1.tenant_id = 1");
+
+        assertSql("SELECT * FROM ((entity,entity1),entity2) " +
+                        "WHERE entity.id = entity1.id and entity.id = entity2.id",
+                "SELECT * FROM ((entity, entity1), entity2) " +
+                        "WHERE entity.id = entity1.id AND entity.id = entity2.id " +
+                        "AND entity.tenant_id = 1 AND entity1.tenant_id = 1 AND entity2.tenant_id = 1");
+
+        assertSql("SELECT * FROM (entity,(entity1,entity2)) " +
+                        "WHERE entity.id = entity1.id and entity.id = entity2.id",
+                "SELECT * FROM (entity, (entity1, entity2)) " +
+                        "WHERE entity.id = entity1.id AND entity.id = entity2.id " +
+                        "AND entity.tenant_id = 1 AND entity1.tenant_id = 1 AND entity2.tenant_id = 1");
+
+        // 沙雕的括号写法
+        assertSql("SELECT * FROM (((entity,entity1))) " +
+                        "WHERE entity.id = entity1.id",
+                "SELECT * FROM (((entity, entity1))) " +
+                        "WHERE entity.id = entity1.id " +
+                        "AND entity.tenant_id = 1 AND entity1.tenant_id = 1");
 
-        // 垃圾 inner join todo
-//        assertSql("SELECT * FROM entity,entity1 " +
-//                "WHERE entity.id = entity1.id",
-//            "SELECT * FROM entity e " +
-//                "INNER JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-//                "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
     }
 
+
     @Test
     void selectWithAs() {
         assertSql("with with_as_A as (select * from entity) select * from with_as_A",
-                "WITH with_as_A AS (SELECT * FROM entity WHERE tenant_id = 1) SELECT * FROM with_as_A");
+                "WITH with_as_A AS (SELECT * FROM entity WHERE entity.tenant_id = 1) SELECT * FROM with_as_A");
+    }
+
+
+    @Test
+    void selectIgnoreTable() {
+        assertSql(" SELECT dict.dict_code, item.item_text AS \"text\", item.item_value AS \"value\" FROM sys_dict_item item INNER JOIN sys_dict dict ON dict.id = item.dict_id WHERE dict.dict_code IN (1, 2, 3) AND item.item_value IN (1, 2, 3)",
+                "SELECT dict.dict_code, item.item_text AS \"text\", item.item_value AS \"value\" FROM sys_dict_item item INNER JOIN sys_dict dict ON dict.id = item.dict_id AND item.tenant_id = 1 WHERE dict.dict_code IN (1, 2, 3) AND item.item_value IN (1, 2, 3)");
     }
 
     private void assertSql(String sql, String targetSql) {
         assertEquals(targetSql, interceptor.parserSingle(sql, null));
     }
 
+
     // ========== 额外的测试 ==========
 
     @Test
     public void testSelectSingle() {
         // 单表
         assertSql("select * from t_user where id = ?",
-                "SELECT * FROM t_user WHERE id = ? AND tenant_id = 1 AND dept_id IN (10, 20)");
+                "SELECT * FROM t_user WHERE id = ? AND t_user.tenant_id = 1 AND t_user.dept_id IN (10, 20)");
 
         assertSql("select * from t_user where id = ? or name = ?",
-                "SELECT * FROM t_user WHERE (id = ? OR name = ?) AND tenant_id = 1 AND dept_id IN (10, 20)");
+                "SELECT * FROM t_user WHERE (id = ? OR name = ?) AND t_user.tenant_id = 1 AND t_user.dept_id IN (10, 20)");
 
         assertSql("SELECT * FROM t_user WHERE (id = ? OR name = ?)",
-                "SELECT * FROM t_user WHERE (id = ? OR name = ?) AND tenant_id = 1 AND dept_id IN (10, 20)");
+                "SELECT * FROM t_user WHERE (id = ? OR name = ?) AND t_user.tenant_id = 1 AND t_user.dept_id IN (10, 20)");
 
         /* not */
         assertSql("SELECT * FROM t_user WHERE not (id = ? OR name = ?)",
-                "SELECT * FROM t_user WHERE NOT (id = ? OR name = ?) AND tenant_id = 1 AND dept_id IN (10, 20)");
+                "SELECT * FROM t_user WHERE NOT (id = ? OR name = ?) AND t_user.tenant_id = 1 AND t_user.dept_id IN (10, 20)");
     }
 
     @Test
@@ -329,16 +493,16 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
                         "right join t_role e1 on e1.id = e.id " +
                         "WHERE e.id = ? OR e.name = ?",
                 "SELECT * FROM t_user e " +
-                        "RIGHT JOIN t_role e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1 AND e.dept_id IN (10, 20)");
+                        "RIGHT JOIN t_role e1 ON e1.id = e.id AND e.tenant_id = 1 AND e.dept_id IN (10, 20) " +
+                        "WHERE (e.id = ? OR e.name = ?) AND e1.tenant_id = 1");
 
         // 条件 e.id = ? OR e.name = ? 带括号
         assertSql("SELECT * FROM t_user e " +
                         "right join t_role e1 on e1.id = e.id " +
                         "WHERE (e.id = ? OR e.name = ?)",
                 "SELECT * FROM t_user e " +
-                        "RIGHT JOIN t_role e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1 AND e.dept_id IN (10, 20)");
+                        "RIGHT JOIN t_role e1 ON e1.id = e.id AND e.tenant_id = 1 AND e.dept_id IN (10, 20) " +
+                        "WHERE (e.id = ? OR e.name = ?) AND e1.tenant_id = 1");
     }
 
     @Test
@@ -348,23 +512,22 @@ public class DataPermissionDatabaseInterceptorTest2 extends BaseMockitoUnitTest
                         "inner join entity1 e1 on e1.id = e.id " +
                         "WHERE e.id = ? OR e.name = ?",
                 "SELECT * FROM t_user e " +
-                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1 AND e.dept_id IN (10, 20)");
+                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 AND e.dept_id IN (10, 20) AND e1.tenant_id = 1 " +
+                        "WHERE e.id = ? OR e.name = ?");
 
         // 条件 e.id = ? OR e.name = ? 带括号
         assertSql("SELECT * FROM t_user e " +
-                        "inner join t_role e1 on e1.id = e.id " +
+                        "inner join entity1 e1 on e1.id = e.id " +
                         "WHERE (e.id = ? OR e.name = ?)",
                 "SELECT * FROM t_user e " +
-                        "INNER JOIN t_role e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-                        "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1 AND e.dept_id IN (10, 20)");
-
-        // 垃圾 inner join todo
-//        assertSql("SELECT * FROM entity,entity1 " +
-//                "WHERE entity.id = entity1.id",
-//            "SELECT * FROM entity e " +
-//                "INNER JOIN entity1 e1 ON e1.id = e.id AND e1.tenant_id = 1 " +
-//                "WHERE (e.id = ? OR e.name = ?) AND e.tenant_id = 1");
+                        "INNER JOIN entity1 e1 ON e1.id = e.id AND e.tenant_id = 1 AND e.dept_id IN (10, 20) AND e1.tenant_id = 1 " +
+                        "WHERE (e.id = ? OR e.name = ?)");
+
+        // 没有 On 的 inner join
+        assertSql("SELECT * FROM entity,entity1 " +
+                "WHERE entity.id = entity1.id",
+            "SELECT * FROM entity, entity1 " +
+                    "WHERE entity.id = entity1.id AND entity.tenant_id = 1 AND entity1.tenant_id = 1");
     }
 
 }

+ 1 - 1
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRuleTest.java

@@ -227,7 +227,7 @@ class DeptDataPermissionRuleTest extends BaseMockitoUnitTest {
             // 调用
             Expression expression = rule.getExpression(tableName, tableAlias);
             // 断言
-            assertEquals("u.dept_id IN (10, 20) OR u.id = 1", expression.toString());
+            assertEquals("(u.dept_id IN (10, 20) OR u.id = 1)", expression.toString());
             assertSame(deptDataPermission, loginUser.getContext(DeptDataPermissionRule.CONTEXT_KEY, DeptDataPermissionRespDTO.class));
         }
     }

+ 2 - 2
yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java

@@ -2,10 +2,10 @@ package cn.iocoder.yudao.framework.dict.config;
 
 import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
 import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
 
-@Configuration
+@AutoConfiguration
 public class YudaoDictAutoConfiguration {
 
     @Bean

+ 4 - 4
yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java

@@ -27,7 +27,7 @@ public class DictFrameworkUtils {
     /**
      * 针对 {@link #getDictDataLabel(String, String)} 的缓存
      */
-    private static final LoadingCache<KeyValue<String, String>, DictDataRespDTO> getDictDataCache = CacheUtils.buildAsyncReloadingCache(
+    private static final LoadingCache<KeyValue<String, String>, DictDataRespDTO> GET_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
             Duration.ofMinutes(1L), // 过期时间 1 分钟
             new CacheLoader<KeyValue<String, String>, DictDataRespDTO>() {
 
@@ -41,7 +41,7 @@ public class DictFrameworkUtils {
     /**
      * 针对 {@link #parseDictDataValue(String, String)} 的缓存
      */
-    private static final LoadingCache<KeyValue<String, String>, DictDataRespDTO> parseDictDataCache = CacheUtils.buildAsyncReloadingCache(
+    private static final LoadingCache<KeyValue<String, String>, DictDataRespDTO> PARSE_DICT_DATA_CACHE = CacheUtils.buildAsyncReloadingCache(
             Duration.ofMinutes(1L), // 过期时间 1 分钟
             new CacheLoader<KeyValue<String, String>, DictDataRespDTO>() {
 
@@ -59,12 +59,12 @@ public class DictFrameworkUtils {
 
     @SneakyThrows
     public static String getDictDataLabel(String dictType, String value) {
-        return getDictDataCache.get(new KeyValue<>(dictType, value)).getLabel();
+        return GET_DICT_DATA_CACHE.get(new KeyValue<>(dictType, value)).getLabel();
     }
 
     @SneakyThrows
     public static String parseDictDataValue(String dictType, String label) {
-        return parseDictDataCache.get(new KeyValue<>(dictType, label)).getValue();
+        return PARSE_DICT_DATA_CACHE.get(new KeyValue<>(dictType, label)).getValue();
     }
 
 }

+ 0 - 2
yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories

@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  cn.iocoder.yudao.framework.dict.config.YudaoDictAutoConfiguration

+ 1 - 0
yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+cn.iocoder.yudao.framework.dict.config.YudaoDictAutoConfiguration

+ 2 - 2
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java

@@ -6,10 +6,10 @@ import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoader;
 import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoaderImpl;
 import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi;
 import org.springframework.beans.factory.annotation.Value;
+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.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
@@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
  *
  * @author 芋道源码
  */
-@Configuration
+@AutoConfiguration
 @ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志
 @EnableConfigurationProperties(ErrorCodeProperties.class)
 @EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码

+ 2 - 2
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java

@@ -10,7 +10,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent;
 import org.springframework.context.event.EventListener;
 import org.springframework.scheduling.annotation.Scheduled;
 
-import java.util.Date;
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -41,7 +41,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader {
     /**
      * 缓存错误码的最大更新时间,用于后续的增量轮询,判断是否有更新
      */
-    private Date maxUpdateTime;
+    private LocalDateTime maxUpdateTime;
 
     @EventListener(ApplicationReadyEvent.class)
     public void loadErrorCodes() {

+ 0 - 2
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring.factories

@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  cn.iocoder.yudao.framework.errorcode.config.YudaoErrorCodeConfiguration

+ 1 - 0
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+cn.iocoder.yudao.framework.errorcode.config.YudaoErrorCodeConfiguration

+ 58 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/pom.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yudao-framework</artifactId>
+        <groupId>cn.iocoder.boot</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>yudao-spring-boot-starter-biz-ip</artifactId>
+    <packaging>jar</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>IP 拓展,支持如下功能:
+        1. IP 功能:查询 IP 对应的城市信息
+            基于 https://gitee.com/lionsoul/ip2region 实现
+        2. 城市功能:查询城市编码对应的城市信息
+            基于 https://github.com/modood/Administrative-divisions-of-China 实现
+    </description>
+    <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
+
+    <properties>
+        <ip2region.version>2.6.6</ip2region.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-common</artifactId>
+        </dependency>
+
+        <!-- IP地址检索 -->
+        <dependency>
+            <groupId>org.lionsoul</groupId>
+            <artifactId>ip2region</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 -->
+        </dependency>
+
+        <!-- Test 测试相关 -->
+        <dependency>
+            <groupId>cn.iocoder.boot</groupId>
+            <artifactId>yudao-spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 55 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/Area.java

@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.framework.ip.core;
+
+import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 区域节点,包括国家、省份、城市、地区等信息
+ *
+ * 数据可见 resources/area.csv 文件
+ *
+ * @author 芋道源码
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class Area {
+
+    /**
+     * 编号 - 全球,即根目录
+     */
+    public static final Integer ID_GLOBAL = 0;
+    /**
+     * 编号 - 中国
+     */
+    public static final Integer ID_CHINA = 1;
+
+    /**
+     * 编号
+     */
+    private Integer id;
+    /**
+     * 名字
+     */
+    private String name;
+    /**
+     * 类型
+     *
+     * 枚举 {@link AreaTypeEnum}
+     */
+    private Integer type;
+
+    /**
+     * 父节点
+     */
+    private Area parent;
+    /**
+     * 子节点
+     */
+    private List<Area> children;
+
+}

+ 39 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/enums/AreaTypeEnum.java

@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.framework.ip.core.enums;
+
+import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+
+/**
+ * 区域类型枚举
+ *
+ * @author 芋道源码
+ */
+@AllArgsConstructor
+@Getter
+public enum AreaTypeEnum implements IntArrayValuable {
+
+    COUNTRY(1, "国家"),
+    PROVINCE(2, "省份"),
+    CITY(3, "城市"),
+    DISTRICT(4, "地区"), // 县、镇、区等
+    ;
+
+    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AreaTypeEnum::getType).toArray();
+
+    /**
+     * 类型
+     */
+    private final Integer type;
+    /**
+     * 名字
+     */
+    private final String name;
+
+    @Override
+    public int[] array() {
+        return ARRAYS;
+    }
+}

+ 119 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java

@@ -0,0 +1,119 @@
+package cn.iocoder.yudao.framework.ip.core.utils;
+
+import cn.hutool.core.io.resource.ResourceUtil;
+import cn.hutool.core.lang.Assert;
+import cn.hutool.core.text.csv.CsvRow;
+import cn.hutool.core.text.csv.CsvUtil;
+import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
+import cn.iocoder.yudao.framework.ip.core.Area;
+import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 区域工具类
+ *
+ * @author 芋道源码
+ */
+@Slf4j
+public class AreaUtils {
+
+    /**
+     * 初始化 SEARCHER
+     */
+    @SuppressWarnings("InstantiationOfUtilityClass")
+    private final static AreaUtils INSTANCE = new AreaUtils();
+
+    /**
+     * Area 内存缓存,提升访问速度
+     */
+    private static Map<Integer, Area> areas;
+
+    private AreaUtils() {
+        long now = System.currentTimeMillis();
+        areas = new HashMap<>();
+        areas.put(Area.ID_GLOBAL, new Area(Area.ID_GLOBAL, "全球", 0,
+                null, new ArrayList<>()));
+        // 从 csv 中加载数据
+        List<CsvRow> rows = CsvUtil.getReader().read(ResourceUtil.getUtf8Reader("area.csv")).getRows();
+        rows.remove(0); // 删除 header
+        for (CsvRow row : rows) {
+            // 创建 Area 对象
+            Area area = new Area(Integer.valueOf(row.get(0)), row.get(1), Integer.valueOf(row.get(2)),
+                    null, new ArrayList<>());
+            // 添加到 areas 中
+            areas.put(area.getId(), area);
+        }
+
+        // 构建父子关系:因为 Area 中没有 parentId 字段,所以需要重复读取
+        for (CsvRow row : rows) {
+            Area area = areas.get(Integer.valueOf(row.get(0))); // 自己
+            Area parent = areas.get(Integer.valueOf(row.get(3))); // 父
+            Assert.isTrue(area != parent, "{}:父子节点相同", area.getName());
+            area.setParent(parent);
+            parent.getChildren().add(area);
+        }
+        log.info("启动加载 AreaUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
+    }
+
+    /**
+     * 获得指定编号对应的区域
+     *
+     * @param id 区域编号
+     * @return 区域
+     */
+    public static Area getArea(Integer id) {
+        return areas.get(id);
+    }
+
+    /**
+     * 格式化区域
+     *
+     * @param id 区域编号
+     * @return 格式化后的区域
+     */
+    public static String format(Integer id) {
+        return format(id, " ");
+    }
+
+    /**
+     * 格式化区域
+     *
+     * 例如说:
+     *      1. id = “静安区”时:上海 上海市 静安区
+     *      2. id = “上海市”时:上海 上海市
+     *      3. id = “上海”时:上海
+     *      4. id = “美国”时:美国
+     * 当区域在中国时,默认不显示中国
+     *
+     * @param id 区域编号
+     * @param separator 分隔符
+     * @return 格式化后的区域
+     */
+    public static String format(Integer id, String separator) {
+        // 获得区域
+        Area area = areas.get(id);
+        if (area == null) {
+            return null;
+        }
+
+        // 格式化
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < AreaTypeEnum.values().length; i++) { // 避免死循环
+            sb.insert(0, area.getName());
+            // “递归”父节点
+            area = area.getParent();
+            if (area == null
+                || ObjectUtils.equalsAny(area.getId(), Area.ID_GLOBAL, Area.ID_CHINA)) { // 跳过父节点为中国的情况
+                break;
+            }
+            sb.insert(0, separator);
+        }
+        return sb.toString();
+    }
+
+}

+ 87 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtils.java

@@ -0,0 +1,87 @@
+package cn.iocoder.yudao.framework.ip.core.utils;
+
+import cn.hutool.core.io.resource.ResourceUtil;
+import cn.iocoder.yudao.framework.ip.core.Area;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.lionsoul.ip2region.xdb.Searcher;
+
+import java.io.IOException;
+
+/**
+ * IP 工具类
+ *
+ * IP 数据源来自 ip2region.xdb 精简版,基于 <a href="https://gitee.com/zhijiantianya/ip2region"/> 项目
+ *
+ * @author wanglhup
+ */
+@Slf4j
+public class IPUtils {
+
+    /**
+     * 初始化 SEARCHER
+     */
+    @SuppressWarnings("InstantiationOfUtilityClass")
+    private final static IPUtils INSTANCE = new IPUtils();
+
+    /**
+     * IP 查询器,启动加载到内存中
+     */
+    private static Searcher SEARCHER;
+
+    /**
+     * 私有化构造
+     */
+    private IPUtils() {
+        try {
+            long now = System.currentTimeMillis();
+            byte[] bytes = ResourceUtil.readBytes("ip2region.xdb");
+            SEARCHER = Searcher.newWithBuffer(bytes);
+            log.info("启动加载 IPUtils 成功,耗时 ({}) 毫秒", System.currentTimeMillis() - now);
+        } catch (IOException e) {
+            log.error("启动加载 IPUtils 失败", e);
+        }
+    }
+
+    /**
+     * 查询 IP 对应的地区编号
+     *
+     * @param ip IP 地址,格式为 127.0.0.1
+     * @return 地区id
+     */
+    @SneakyThrows
+    public static Integer getAreaId(String ip) {
+        return Integer.parseInt(SEARCHER.search(ip));
+    }
+
+    /**
+     * 查询 IP 对应的地区编号
+     *
+     * @param ip IP 地址的时间戳,格式参考{@link Searcher#checkIP(String)} 的返回
+     * @return 地区编号
+     */
+    @SneakyThrows
+    public static Integer getAreaId(long ip) {
+        return Integer.parseInt(SEARCHER.search(ip));
+    }
+
+    /**
+     * 查询 IP 对应的地区
+     *
+     * @param ip IP 地址,格式为 127.0.0.1
+     * @return 地区
+     */
+    public static Area getArea(String ip) {
+        return AreaUtils.getArea(getAreaId(ip));
+    }
+
+    /**
+     * 查询 IP 对应的地区
+     *
+     * @param ip IP 地址的时间戳,格式参考{@link Searcher#checkIP(String)} 的返回
+     * @return 地区
+     */
+    public static Area getArea(long ip) {
+        return AreaUtils.getArea(getAreaId(ip));
+    }
+}

+ 11 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/package-info.java

@@ -0,0 +1,11 @@
+/**
+ * IP 拓展,支持如下功能:
+ *
+ * 1. IP 功能:查询 IP 对应的城市信息
+ *      基于 https://gitee.com/lionsoul/ip2region 实现
+ * 2. 城市功能:查询城市编码对应的城市信息
+ *      基于 https://github.com/modood/Administrative-divisions-of-China 实现
+ *
+ * @author 芋道源码
+ */
+package cn.iocoder.yudao.framework.ip;

+ 3608 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/area.csv

@@ -0,0 +1,3608 @@
+id,name,type,parentId
+1,中国,1,0
+2,蒙古,1,0
+3,朝鲜,1,0
+4,韩国,1,0
+5,日本,1,0
+6,菲律宾,1,0
+7,越南,1,0
+8,老挝,1,0
+9,柬埔寨,1,0
+10,缅甸,1,0
+11,泰国,1,0
+12,马来西亚,1,0
+13,文莱,1,0
+14,新加坡,1,0
+15,印度尼西亚,1,0
+16,东帝汶,1,0
+17,尼泊尔,1,0
+18,不丹,1,0
+19,孟加拉国,1,0
+20,印度,1,0
+21,巴基斯坦,1,0
+22,斯里兰卡,1,0
+23,马尔代夫,1,0
+24,哈萨克斯坦,1,0
+25,吉尔吉斯斯坦,1,0
+26,塔吉克斯坦,1,0
+27,乌兹别克斯坦,1,0
+28,土库曼斯坦,1,0
+29,阿富汗,1,0
+30,伊拉克,1,0
+31,伊朗,1,0
+32,叙利亚,1,0
+33,约旦,1,0
+34,黎巴嫩,1,0
+35,以色列,1,0
+36,巴勒斯坦,1,0
+37,沙特阿拉伯,1,0
+38,巴林,1,0
+39,卡塔尔,1,0
+40,科威特,1,0
+41,阿拉伯联合酋长国,1,0
+42,阿曼,1,0
+43,也门,1,0
+44,格鲁吉亚,1,0
+45,亚美尼亚,1,0
+46,阿塞拜疆,1,0
+47,土耳其,1,0
+48,塞浦路斯,1,0
+49,芬兰,1,0
+50,瑞典,1,0
+51,挪威,1,0
+52,冰岛,1,0
+53,丹麦,1,0
+54,爱沙尼亚,1,0
+55,拉脱维亚,1,0
+56,立陶宛,1,0
+57,白俄罗斯,1,0
+58,俄罗斯,1,0
+59,乌克兰,1,0
+60,摩尔多瓦,1,0
+61,波兰,1,0
+62,捷克,1,0
+63,斯洛伐克,1,0
+64,匈牙利,1,0
+65,德国,1,0
+66,奥地利,1,0
+67,瑞士,1,0
+68,列支敦士登,1,0
+69,英国,1,0
+70,爱尔兰,1,0
+71,荷兰,1,0
+72,比利时,1,0
+73,卢森堡,1,0
+74,法国,1,0
+75,摩纳哥,1,0
+76,罗马尼亚,1,0
+77,保加利亚,1,0
+78,塞尔维亚,1,0
+79,马其顿,1,0
+80,阿尔巴尼亚,1,0
+81,希腊,1,0
+82,斯洛文尼亚,1,0
+83,克罗地亚,1,0
+84,波斯尼亚和墨塞哥维那,1,0
+85,意大利,1,0
+86,梵蒂冈,1,0
+87,圣马力诺,1,0
+88,马耳他,1,0
+89,西班牙,1,0
+90,葡萄牙,1,0
+91,安道尔共和国,1,0
+92,埃及,1,0
+93,利比亚,1,0
+94,苏丹,1,0
+95,突尼斯,1,0
+96,阿尔及利亚,1,0
+97,摩洛哥,1,0
+98,亚速尔群岛,1,0
+99,马德拉群岛,1,0
+100,埃塞俄比亚,1,0
+101,厄立特里亚,1,0
+102,索马里,1,0
+103,吉布提,1,0
+104,肯尼亚,1,0
+105,坦桑尼亚,1,0
+106,乌干达,1,0
+107,卢旺达,1,0
+108,布隆迪,1,0
+109,塞舌尔,1,0
+110,圣多美及普林西比,1,0
+111,塞内加尔,1,0
+112,冈比亚,1,0
+113,马里,1,0
+114,布基纳法索,1,0
+115,几内亚,1,0
+116,几内亚比绍,1,0
+117,佛得角,1,0
+118,塞拉利昂,1,0
+119,利比里亚,1,0
+120,科特迪瓦,1,0
+121,加纳,1,0
+122,多哥,1,0
+123,贝宁,1,0
+124,尼日尔,1,0
+125,加那利群岛,1,0
+126,赞比亚,1,0
+127,安哥拉,1,0
+128,津巴布韦,1,0
+129,马拉维,1,0
+130,莫桑比克,1,0
+131,博茨瓦纳,1,0
+132,纳米比亚,1,0
+133,南非,1,0
+134,斯威士兰,1,0
+135,莱索托,1,0
+136,马达加斯加,1,0
+137,科摩罗,1,0
+138,毛里求斯,1,0
+139,留尼旺,1,0
+140,圣赫勒拿,1,0
+141,澳大利亚,1,0
+142,新西兰,1,0
+143,巴布亚新几内亚,1,0
+144,所罗门群岛,1,0
+145,瓦努阿图共和国,1,0
+146,密克罗尼西亚,1,0
+147,马绍尔群岛,1,0
+148,帕劳,1,0
+149,瑙鲁,1,0
+150,基里巴斯,1,0
+151,图瓦卢,1,0
+152,萨摩亚,1,0
+153,斐济,1,0
+154,汤加,1,0
+155,库克群岛,1,0
+156,关岛,1,0
+157,新喀里多尼亚,1,0
+158,法属波利尼西亚,1,0
+159,皮特凯恩岛,1,0
+160,瓦利斯与富图纳,1,0
+161,纽埃,1,0
+162,托克劳,1,0
+163,美属萨摩亚,1,0
+164,北马里亚纳,1,0
+165,加拿大,1,0
+166,美国,1,0
+167,墨西哥,1,0
+168,格陵兰,1,0
+169,危地马拉,1,0
+170,伯利兹,1,0
+171,萨尔瓦多,1,0
+172,洪都拉斯,1,0
+173,尼加拉瓜,1,0
+174,哥斯达黎加,1,0
+175,巴拿马,1,0
+176,巴哈马,1,0
+177,古巴,1,0
+178,牙买加,1,0
+179,海地,1,0
+180,多米尼加共和国,1,0
+181,安提瓜和巴布达,1,0
+182,圣基茨和尼维斯,1,0
+183,多米尼克,1,0
+184,圣卢西亚,1,0
+185,圣文森特和格林纳丁斯,1,0
+186,格林纳达,1,0
+187,巴巴多斯,1,0
+188,特立尼达和多巴哥,1,0
+189,波多黎各,1,0
+190,英属维尔京群岛,1,0
+191,美属维尔京群岛,1,0
+192,安圭拉,1,0
+193,蒙特塞拉特岛,1,0
+194,瓜德罗普,1,0
+195,马提尼克,1,0
+196,荷属安的列斯,1,0
+197,阿鲁巴,1,0
+198,特克斯和凯科斯群岛,1,0
+199,开曼群岛,1,0
+200,百慕大,1,0
+201,哥伦比亚,1,0
+202,委内瑞拉,1,0
+203,圭亚那,1,0
+204,法属圭亚那,1,0
+205,苏里南,1,0
+206,厄瓜多尔,1,0
+207,秘鲁,1,0
+208,玻利维亚,1,0
+209,巴西,1,0
+210,智利,1,0
+211,阿根廷,1,0
+212,乌拉圭,1,0
+213,巴拉圭,1,0
+214,波黑,1,0
+215,直布罗陀,1,0
+216,新喀里多尼亚群岛,1,0
+217,瓦利斯和富图纳群岛,1,0
+218,泽西岛,1,0
+219,黑山,1,0
+220,英属马恩岛,1,0
+221,尼日利亚,1,0
+222,喀麦隆,1,0
+223,加蓬,1,0
+224,乍得,1,0
+225,刚果共和国,1,0
+226,中非共和国,1,0
+227,南苏丹,1,0
+228,赤道几内亚,1,0
+229,毛里塔尼亚,1,0
+230,刚果民主共和国,1,0
+231,留尼汪岛,1,0
+232,格陵兰岛,1,0
+233,法罗群岛,1,0
+234,根西岛,1,0
+235,百慕大群岛,1,0
+236,圣皮埃尔和密克隆群岛,1,0
+237,法属圣马丁,1,0
+238,奥兰群岛,1,0
+239,北马里亚纳群岛,1,0
+240,库拉索,1,0
+241,博内尔岛,1,0
+242,圣马丁岛,1,0
+243,圣巴泰勒米岛,1,0
+244,福克兰群岛,1,0
+245,圣多美和普林西比,1,0
+246,英属印度洋领地,1,0
+247,东萨摩亚,1,0
+248,诺福克岛,1,0
+110000,北京,2,1
+120000,天津,2,1
+130000,河北省,2,1
+140000,山西省,2,1
+150000,内蒙古自治区,2,1
+210000,辽宁省,2,1
+220000,吉林省,2,1
+230000,黑龙江省,2,1
+310000,上海,2,1
+320000,江苏省,2,1
+330000,浙江省,2,1
+340000,安徽省,2,1
+350000,福建省,2,1
+360000,江西省,2,1
+370000,山东省,2,1
+410000,河南省,2,1
+420000,湖北省,2,1
+430000,湖南省,2,1
+440000,广东省,2,1
+450000,广西壮族自治区,2,1
+460000,海南省,2,1
+500000,重庆,2,1
+510000,四川省,2,1
+520000,贵州省,2,1
+530000,云南省,2,1
+540000,西藏自治区,2,1
+610000,陕西省,2,1
+620000,甘肃省,2,1
+630000,青海省,2,1
+640000,宁夏回族自治区,2,1
+650000,新疆维吾尔自治区,2,1
+110100,北京市,3,110000
+120100,天津市,3,120000
+130100,石家庄市,3,130000
+130200,唐山市,3,130000
+130300,秦皇岛市,3,130000
+130400,邯郸市,3,130000
+130500,邢台市,3,130000
+130600,保定市,3,130000
+130700,张家口市,3,130000
+130800,承德市,3,130000
+130900,沧州市,3,130000
+131000,廊坊市,3,130000
+131100,衡水市,3,130000
+140100,太原市,3,140000
+140200,大同市,3,140000
+140300,阳泉市,3,140000
+140400,长治市,3,140000
+140500,晋城市,3,140000
+140600,朔州市,3,140000
+140700,晋中市,3,140000
+140800,运城市,3,140000
+140900,忻州市,3,140000
+141000,临汾市,3,140000
+141100,吕梁市,3,140000
+150100,呼和浩特市,3,150000
+150200,包头市,3,150000
+150300,乌海市,3,150000
+150400,赤峰市,3,150000
+150500,通辽市,3,150000
+150600,鄂尔多斯市,3,150000
+150700,呼伦贝尔市,3,150000
+150800,巴彦淖尔市,3,150000
+150900,乌兰察布市,3,150000
+152200,兴安盟,3,150000
+152500,锡林郭勒盟,3,150000
+152900,阿拉善盟,3,150000
+210100,沈阳市,3,210000
+210200,大连市,3,210000
+210300,鞍山市,3,210000
+210400,抚顺市,3,210000
+210500,本溪市,3,210000
+210600,丹东市,3,210000
+210700,锦州市,3,210000
+210800,营口市,3,210000
+210900,阜新市,3,210000
+211000,辽阳市,3,210000
+211100,盘锦市,3,210000
+211200,铁岭市,3,210000
+211300,朝阳市,3,210000
+211400,葫芦岛市,3,210000
+220100,长春市,3,220000
+220200,吉林市,3,220000
+220300,四平市,3,220000
+220400,辽源市,3,220000
+220500,通化市,3,220000
+220600,白山市,3,220000
+220700,松原市,3,220000
+220800,白城市,3,220000
+222400,延边朝鲜族自治州,3,220000
+230100,哈尔滨市,3,230000
+230200,齐齐哈尔市,3,230000
+230300,鸡西市,3,230000
+230400,鹤岗市,3,230000
+230500,双鸭山市,3,230000
+230600,大庆市,3,230000
+230700,伊春市,3,230000
+230800,佳木斯市,3,230000
+230900,七台河市,3,230000
+231000,牡丹江市,3,230000
+231100,黑河市,3,230000
+231200,绥化市,3,230000
+232700,大兴安岭地区,3,230000
+310100,上海市,3,310000
+320100,南京市,3,320000
+320200,无锡市,3,320000
+320300,徐州市,3,320000
+320400,常州市,3,320000
+320500,苏州市,3,320000
+320600,南通市,3,320000
+320700,连云港市,3,320000
+320800,淮安市,3,320000
+320900,盐城市,3,320000
+321000,扬州市,3,320000
+321100,镇江市,3,320000
+321200,泰州市,3,320000
+321300,宿迁市,3,320000
+330100,杭州市,3,330000
+330200,宁波市,3,330000
+330300,温州市,3,330000
+330400,嘉兴市,3,330000
+330500,湖州市,3,330000
+330600,绍兴市,3,330000
+330700,金华市,3,330000
+330800,衢州市,3,330000
+330900,舟山市,3,330000
+331000,台州市,3,330000
+331100,丽水市,3,330000
+340100,合肥市,3,340000
+340200,芜湖市,3,340000
+340300,蚌埠市,3,340000
+340400,淮南市,3,340000
+340500,马鞍山市,3,340000
+340600,淮北市,3,340000
+340700,铜陵市,3,340000
+340800,安庆市,3,340000
+341000,黄山市,3,340000
+341100,滁州市,3,340000
+341200,阜阳市,3,340000
+341300,宿州市,3,340000
+341500,六安市,3,340000
+341600,亳州市,3,340000
+341700,池州市,3,340000
+341800,宣城市,3,340000
+350100,福州市,3,350000
+350200,厦门市,3,350000
+350300,莆田市,3,350000
+350400,三明市,3,350000
+350500,泉州市,3,350000
+350600,漳州市,3,350000
+350700,南平市,3,350000
+350800,龙岩市,3,350000
+350900,宁德市,3,350000
+360100,南昌市,3,360000
+360200,景德镇市,3,360000
+360300,萍乡市,3,360000
+360400,九江市,3,360000
+360500,新余市,3,360000
+360600,鹰潭市,3,360000
+360700,赣州市,3,360000
+360800,吉安市,3,360000
+360900,宜春市,3,360000
+361000,抚州市,3,360000
+361100,上饶市,3,360000
+370100,济南市,3,370000
+370200,青岛市,3,370000
+370300,淄博市,3,370000
+370400,枣庄市,3,370000
+370500,东营市,3,370000
+370600,烟台市,3,370000
+370700,潍坊市,3,370000
+370800,济宁市,3,370000
+370900,泰安市,3,370000
+371000,威海市,3,370000
+371100,日照市,3,370000
+371300,临沂市,3,370000
+371400,德州市,3,370000
+371500,聊城市,3,370000
+371600,滨州市,3,370000
+371700,菏泽市,3,370000
+410100,郑州市,3,410000
+410200,开封市,3,410000
+410300,洛阳市,3,410000
+410400,平顶山市,3,410000
+410500,安阳市,3,410000
+410600,鹤壁市,3,410000
+410700,新乡市,3,410000
+410800,焦作市,3,410000
+410900,濮阳市,3,410000
+411000,许昌市,3,410000
+411100,漯河市,3,410000
+411200,三门峡市,3,410000
+411300,南阳市,3,410000
+411400,商丘市,3,410000
+411500,信阳市,3,410000
+411600,周口市,3,410000
+411700,驻马店市,3,410000
+419000,省直辖县级行政区划,3,410000
+420100,武汉市,3,420000
+420200,黄石市,3,420000
+420300,十堰市,3,420000
+420500,宜昌市,3,420000
+420600,襄阳市,3,420000
+420700,鄂州市,3,420000
+420800,荆门市,3,420000
+420900,孝感市,3,420000
+421000,荆州市,3,420000
+421100,黄冈市,3,420000
+421200,咸宁市,3,420000
+421300,随州市,3,420000
+422800,恩施土家族苗族自治州,3,420000
+429000,省直辖县级行政区划,3,420000
+430100,长沙市,3,430000
+430200,株洲市,3,430000
+430300,湘潭市,3,430000
+430400,衡阳市,3,430000
+430500,邵阳市,3,430000
+430600,岳阳市,3,430000
+430700,常德市,3,430000
+430800,张家界市,3,430000
+430900,益阳市,3,430000
+431000,郴州市,3,430000
+431100,永州市,3,430000
+431200,怀化市,3,430000
+431300,娄底市,3,430000
+433100,湘西土家族苗族自治州,3,430000
+440100,广州市,3,440000
+440200,韶关市,3,440000
+440300,深圳市,3,440000
+440400,珠海市,3,440000
+440500,汕头市,3,440000
+440600,佛山市,3,440000
+440700,江门市,3,440000
+440800,湛江市,3,440000
+440900,茂名市,3,440000
+441200,肇庆市,3,440000
+441300,惠州市,3,440000
+441400,梅州市,3,440000
+441500,汕尾市,3,440000
+441600,河源市,3,440000
+441700,阳江市,3,440000
+441800,清远市,3,440000
+441900,东莞市,3,440000
+442000,中山市,3,440000
+445100,潮州市,3,440000
+445200,揭阳市,3,440000
+445300,云浮市,3,440000
+450100,南宁市,3,450000
+450200,柳州市,3,450000
+450300,桂林市,3,450000
+450400,梧州市,3,450000
+450500,北海市,3,450000
+450600,防城港市,3,450000
+450700,钦州市,3,450000
+450800,贵港市,3,450000
+450900,玉林市,3,450000
+451000,百色市,3,450000
+451100,贺州市,3,450000
+451200,河池市,3,450000
+451300,来宾市,3,450000
+451400,崇左市,3,450000
+460100,海口市,3,460000
+460200,三亚市,3,460000
+460300,三沙市,3,460000
+460400,儋州市,3,460000
+469000,省直辖县级行政区划,3,460000
+500100,重庆市,3,500000
+510100,成都市,3,510000
+510300,自贡市,3,510000
+510400,攀枝花市,3,510000
+510500,泸州市,3,510000
+510600,德阳市,3,510000
+510700,绵阳市,3,510000
+510800,广元市,3,510000
+510900,遂宁市,3,510000
+511000,内江市,3,510000
+511100,乐山市,3,510000
+511300,南充市,3,510000
+511400,眉山市,3,510000
+511500,宜宾市,3,510000
+511600,广安市,3,510000
+511700,达州市,3,510000
+511800,雅安市,3,510000
+511900,巴中市,3,510000
+512000,资阳市,3,510000
+513200,阿坝藏族羌族自治州,3,510000
+513300,甘孜藏族自治州,3,510000
+513400,凉山彝族自治州,3,510000
+520100,贵阳市,3,520000
+520200,六盘水市,3,520000
+520300,遵义市,3,520000
+520400,安顺市,3,520000
+520500,毕节市,3,520000
+520600,铜仁市,3,520000
+522300,黔西南布依族苗族自治州,3,520000
+522600,黔东南苗族侗族自治州,3,520000
+522700,黔南布依族苗族自治州,3,520000
+530100,昆明市,3,530000
+530300,曲靖市,3,530000
+530400,玉溪市,3,530000
+530500,保山市,3,530000
+530600,昭通市,3,530000
+530700,丽江市,3,530000
+530800,普洱市,3,530000
+530900,临沧市,3,530000
+532300,楚雄彝族自治州,3,530000
+532500,红河哈尼族彝族自治州,3,530000
+532600,文山壮族苗族自治州,3,530000
+532800,西双版纳傣族自治州,3,530000
+532900,大理白族自治州,3,530000
+533100,德宏傣族景颇族自治州,3,530000
+533300,怒江傈僳族自治州,3,530000
+533400,迪庆藏族自治州,3,530000
+540100,拉萨市,3,540000
+540200,日喀则市,3,540000
+540300,昌都市,3,540000
+540400,林芝市,3,540000
+540500,山南市,3,540000
+540600,那曲市,3,540000
+542500,阿里地区,3,540000
+610100,西安市,3,610000
+610200,铜川市,3,610000
+610300,宝鸡市,3,610000
+610400,咸阳市,3,610000
+610500,渭南市,3,610000
+610600,延安市,3,610000
+610700,汉中市,3,610000
+610800,榆林市,3,610000
+610900,安康市,3,610000
+611000,商洛市,3,610000
+620100,兰州市,3,620000
+620200,嘉峪关市,3,620000
+620300,金昌市,3,620000
+620400,白银市,3,620000
+620500,天水市,3,620000
+620600,武威市,3,620000
+620700,张掖市,3,620000
+620800,平凉市,3,620000
+620900,酒泉市,3,620000
+621000,庆阳市,3,620000
+621100,定西市,3,620000
+621200,陇南市,3,620000
+622900,临夏回族自治州,3,620000
+623000,甘南藏族自治州,3,620000
+630100,西宁市,3,630000
+630200,海东市,3,630000
+632200,海北藏族自治州,3,630000
+632300,黄南藏族自治州,3,630000
+632500,海南藏族自治州,3,630000
+632600,果洛藏族自治州,3,630000
+632700,玉树藏族自治州,3,630000
+632800,海西蒙古族藏族自治州,3,630000
+640100,银川市,3,640000
+640200,石嘴山市,3,640000
+640300,吴忠市,3,640000
+640400,固原市,3,640000
+640500,中卫市,3,640000
+650100,乌鲁木齐市,3,650000
+650200,克拉玛依市,3,650000
+650400,吐鲁番市,3,650000
+650500,哈密市,3,650000
+652300,昌吉回族自治州,3,650000
+652700,博尔塔拉蒙古自治州,3,650000
+652800,巴音郭楞蒙古自治州,3,650000
+652900,阿克苏地区,3,650000
+653000,克孜勒苏柯尔克孜自治州,3,650000
+653100,喀什地区,3,650000
+653200,和田地区,3,650000
+654000,伊犁哈萨克自治州,3,650000
+654200,塔城地区,3,650000
+654300,阿勒泰地区,3,650000
+659000,自治区直辖县级行政区划,3,650000
+110101,东城区,4,110100
+110102,西城区,4,110100
+110105,朝阳区,4,110100
+110106,丰台区,4,110100
+110107,石景山区,4,110100
+110108,海淀区,4,110100
+110109,门头沟区,4,110100
+110111,房山区,4,110100
+110112,通州区,4,110100
+110113,顺义区,4,110100
+110114,昌平区,4,110100
+110115,大兴区,4,110100
+110116,怀柔区,4,110100
+110117,平谷区,4,110100
+110118,密云区,4,110100
+110119,延庆区,4,110100
+120101,和平区,4,120100
+120102,河东区,4,120100
+120103,河西区,4,120100
+120104,南开区,4,120100
+120105,河北区,4,120100
+120106,红桥区,4,120100
+120110,东丽区,4,120100
+120111,西青区,4,120100
+120112,津南区,4,120100
+120113,北辰区,4,120100
+120114,武清区,4,120100
+120115,宝坻区,4,120100
+120116,滨海新区,4,120100
+120117,宁河区,4,120100
+120118,静海区,4,120100
+120119,蓟州区,4,120100
+130102,长安区,4,130100
+130104,桥西区,4,130100
+130105,新华区,4,130100
+130107,井陉矿区,4,130100
+130108,裕华区,4,130100
+130109,藁城区,4,130100
+130110,鹿泉区,4,130100
+130111,栾城区,4,130100
+130121,井陉县,4,130100
+130123,正定县,4,130100
+130125,行唐县,4,130100
+130126,灵寿县,4,130100
+130127,高邑县,4,130100
+130128,深泽县,4,130100
+130129,赞皇县,4,130100
+130130,无极县,4,130100
+130131,平山县,4,130100
+130132,元氏县,4,130100
+130133,赵县,4,130100
+130171,石家庄高新技术产业开发区,4,130100
+130172,石家庄循环化工园区,4,130100
+130181,辛集市,4,130100
+130183,晋州市,4,130100
+130184,新乐市,4,130100
+130202,路南区,4,130200
+130203,路北区,4,130200
+130204,古冶区,4,130200
+130205,开平区,4,130200
+130207,丰南区,4,130200
+130208,丰润区,4,130200
+130209,曹妃甸区,4,130200
+130224,滦南县,4,130200
+130225,乐亭县,4,130200
+130227,迁西县,4,130200
+130229,玉田县,4,130200
+130271,河北唐山芦台经济开发区,4,130200
+130272,唐山市汉沽管理区,4,130200
+130273,唐山高新技术产业开发区,4,130200
+130274,河北唐山海港经济开发区,4,130200
+130281,遵化市,4,130200
+130283,迁安市,4,130200
+130284,滦州市,4,130200
+130302,海港区,4,130300
+130303,山海关区,4,130300
+130304,北戴河区,4,130300
+130306,抚宁区,4,130300
+130321,青龙满族自治县,4,130300
+130322,昌黎县,4,130300
+130324,卢龙县,4,130300
+130371,秦皇岛市经济技术开发区,4,130300
+130372,北戴河新区,4,130300
+130402,邯山区,4,130400
+130403,丛台区,4,130400
+130404,复兴区,4,130400
+130406,峰峰矿区,4,130400
+130407,肥乡区,4,130400
+130408,永年区,4,130400
+130423,临漳县,4,130400
+130424,成安县,4,130400
+130425,大名县,4,130400
+130426,涉县,4,130400
+130427,磁县,4,130400
+130430,邱县,4,130400
+130431,鸡泽县,4,130400
+130432,广平县,4,130400
+130433,馆陶县,4,130400
+130434,魏县,4,130400
+130435,曲周县,4,130400
+130471,邯郸经济技术开发区,4,130400
+130473,邯郸冀南新区,4,130400
+130481,武安市,4,130400
+130502,襄都区,4,130500
+130503,信都区,4,130500
+130505,任泽区,4,130500
+130506,南和区,4,130500
+130522,临城县,4,130500
+130523,内丘县,4,130500
+130524,柏乡县,4,130500
+130525,隆尧县,4,130500
+130528,宁晋县,4,130500
+130529,巨鹿县,4,130500
+130530,新河县,4,130500
+130531,广宗县,4,130500
+130532,平乡县,4,130500
+130533,威县,4,130500
+130534,清河县,4,130500
+130535,临西县,4,130500
+130571,河北邢台经济开发区,4,130500
+130581,南宫市,4,130500
+130582,沙河市,4,130500
+130602,竞秀区,4,130600
+130606,莲池区,4,130600
+130607,满城区,4,130600
+130608,清苑区,4,130600
+130609,徐水区,4,130600
+130623,涞水县,4,130600
+130624,阜平县,4,130600
+130626,定兴县,4,130600
+130627,唐县,4,130600
+130628,高阳县,4,130600
+130629,容城县,4,130600
+130630,涞源县,4,130600
+130631,望都县,4,130600
+130632,安新县,4,130600
+130633,易县,4,130600
+130634,曲阳县,4,130600
+130635,蠡县,4,130600
+130636,顺平县,4,130600
+130637,博野县,4,130600
+130638,雄县,4,130600
+130671,保定高新技术产业开发区,4,130600
+130672,保定白沟新城,4,130600
+130681,涿州市,4,130600
+130682,定州市,4,130600
+130683,安国市,4,130600
+130684,高碑店市,4,130600
+130702,桥东区,4,130700
+130703,桥西区,4,130700
+130705,宣化区,4,130700
+130706,下花园区,4,130700
+130708,万全区,4,130700
+130709,崇礼区,4,130700
+130722,张北县,4,130700
+130723,康保县,4,130700
+130724,沽源县,4,130700
+130725,尚义县,4,130700
+130726,蔚县,4,130700
+130727,阳原县,4,130700
+130728,怀安县,4,130700
+130730,怀来县,4,130700
+130731,涿鹿县,4,130700
+130732,赤城县,4,130700
+130771,张家口经济开发区,4,130700
+130772,张家口市察北管理区,4,130700
+130773,张家口市塞北管理区,4,130700
+130802,双桥区,4,130800
+130803,双滦区,4,130800
+130804,鹰手营子矿区,4,130800
+130821,承德县,4,130800
+130822,兴隆县,4,130800
+130824,滦平县,4,130800
+130825,隆化县,4,130800
+130826,丰宁满族自治县,4,130800
+130827,宽城满族自治县,4,130800
+130828,围场满族蒙古族自治县,4,130800
+130871,承德高新技术产业开发区,4,130800
+130881,平泉市,4,130800
+130902,新华区,4,130900
+130903,运河区,4,130900
+130921,沧县,4,130900
+130922,青县,4,130900
+130923,东光县,4,130900
+130924,海兴县,4,130900
+130925,盐山县,4,130900
+130926,肃宁县,4,130900
+130927,南皮县,4,130900
+130928,吴桥县,4,130900
+130929,献县,4,130900
+130930,孟村回族自治县,4,130900
+130971,河北沧州经济开发区,4,130900
+130972,沧州高新技术产业开发区,4,130900
+130973,沧州渤海新区,4,130900
+130981,泊头市,4,130900
+130982,任丘市,4,130900
+130983,黄骅市,4,130900
+130984,河间市,4,130900
+131002,安次区,4,131000
+131003,广阳区,4,131000
+131022,固安县,4,131000
+131023,永清县,4,131000
+131024,香河县,4,131000
+131025,大城县,4,131000
+131026,文安县,4,131000
+131028,大厂回族自治县,4,131000
+131071,廊坊经济技术开发区,4,131000
+131081,霸州市,4,131000
+131082,三河市,4,131000
+131102,桃城区,4,131100
+131103,冀州区,4,131100
+131121,枣强县,4,131100
+131122,武邑县,4,131100
+131123,武强县,4,131100
+131124,饶阳县,4,131100
+131125,安平县,4,131100
+131126,故城县,4,131100
+131127,景县,4,131100
+131128,阜城县,4,131100
+131171,河北衡水高新技术产业开发区,4,131100
+131172,衡水滨湖新区,4,131100
+131182,深州市,4,131100
+140105,小店区,4,140100
+140106,迎泽区,4,140100
+140107,杏花岭区,4,140100
+140108,尖草坪区,4,140100
+140109,万柏林区,4,140100
+140110,晋源区,4,140100
+140121,清徐县,4,140100
+140122,阳曲县,4,140100
+140123,娄烦县,4,140100
+140171,山西转型综合改革示范区,4,140100
+140181,古交市,4,140100
+140212,新荣区,4,140200
+140213,平城区,4,140200
+140214,云冈区,4,140200
+140215,云州区,4,140200
+140221,阳高县,4,140200
+140222,天镇县,4,140200
+140223,广灵县,4,140200
+140224,灵丘县,4,140200
+140225,浑源县,4,140200
+140226,左云县,4,140200
+140271,山西大同经济开发区,4,140200
+140302,城区,4,140300
+140303,矿区,4,140300
+140311,郊区,4,140300
+140321,平定县,4,140300
+140322,盂县,4,140300
+140403,潞州区,4,140400
+140404,上党区,4,140400
+140405,屯留区,4,140400
+140406,潞城区,4,140400
+140423,襄垣县,4,140400
+140425,平顺县,4,140400
+140426,黎城县,4,140400
+140427,壶关县,4,140400
+140428,长子县,4,140400
+140429,武乡县,4,140400
+140430,沁县,4,140400
+140431,沁源县,4,140400
+140471,山西长治高新技术产业园区,4,140400
+140502,城区,4,140500
+140521,沁水县,4,140500
+140522,阳城县,4,140500
+140524,陵川县,4,140500
+140525,泽州县,4,140500
+140581,高平市,4,140500
+140602,朔城区,4,140600
+140603,平鲁区,4,140600
+140621,山阴县,4,140600
+140622,应县,4,140600
+140623,右玉县,4,140600
+140671,山西朔州经济开发区,4,140600
+140681,怀仁市,4,140600
+140702,榆次区,4,140700
+140703,太谷区,4,140700
+140721,榆社县,4,140700
+140722,左权县,4,140700
+140723,和顺县,4,140700
+140724,昔阳县,4,140700
+140725,寿阳县,4,140700
+140727,祁县,4,140700
+140728,平遥县,4,140700
+140729,灵石县,4,140700
+140781,介休市,4,140700
+140802,盐湖区,4,140800
+140821,临猗县,4,140800
+140822,万荣县,4,140800
+140823,闻喜县,4,140800
+140824,稷山县,4,140800
+140825,新绛县,4,140800
+140826,绛县,4,140800
+140827,垣曲县,4,140800
+140828,夏县,4,140800
+140829,平陆县,4,140800
+140830,芮城县,4,140800
+140881,永济市,4,140800
+140882,河津市,4,140800
+140902,忻府区,4,140900
+140921,定襄县,4,140900
+140922,五台县,4,140900
+140923,代县,4,140900
+140924,繁峙县,4,140900
+140925,宁武县,4,140900
+140926,静乐县,4,140900
+140927,神池县,4,140900
+140928,五寨县,4,140900
+140929,岢岚县,4,140900
+140930,河曲县,4,140900
+140931,保德县,4,140900
+140932,偏关县,4,140900
+140971,五台山风景名胜区,4,140900
+140981,原平市,4,140900
+141002,尧都区,4,141000
+141021,曲沃县,4,141000
+141022,翼城县,4,141000
+141023,襄汾县,4,141000
+141024,洪洞县,4,141000
+141025,古县,4,141000
+141026,安泽县,4,141000
+141027,浮山县,4,141000
+141028,吉县,4,141000
+141029,乡宁县,4,141000
+141030,大宁县,4,141000
+141031,隰县,4,141000
+141032,永和县,4,141000
+141033,蒲县,4,141000
+141034,汾西县,4,141000
+141081,侯马市,4,141000
+141082,霍州市,4,141000
+141102,离石区,4,141100
+141121,文水县,4,141100
+141122,交城县,4,141100
+141123,兴县,4,141100
+141124,临县,4,141100
+141125,柳林县,4,141100
+141126,石楼县,4,141100
+141127,岚县,4,141100
+141128,方山县,4,141100
+141129,中阳县,4,141100
+141130,交口县,4,141100
+141181,孝义市,4,141100
+141182,汾阳市,4,141100
+150102,新城区,4,150100
+150103,回民区,4,150100
+150104,玉泉区,4,150100
+150105,赛罕区,4,150100
+150121,土默特左旗,4,150100
+150122,托克托县,4,150100
+150123,和林格尔县,4,150100
+150124,清水河县,4,150100
+150125,武川县,4,150100
+150172,呼和浩特经济技术开发区,4,150100
+150202,东河区,4,150200
+150203,昆都仑区,4,150200
+150204,青山区,4,150200
+150205,石拐区,4,150200
+150206,白云鄂博矿区,4,150200
+150207,九原区,4,150200
+150221,土默特右旗,4,150200
+150222,固阳县,4,150200
+150223,达尔罕茂明安联合旗,4,150200
+150271,包头稀土高新技术产业开发区,4,150200
+150302,海勃湾区,4,150300
+150303,海南区,4,150300
+150304,乌达区,4,150300
+150402,红山区,4,150400
+150403,元宝山区,4,150400
+150404,松山区,4,150400
+150421,阿鲁科尔沁旗,4,150400
+150422,巴林左旗,4,150400
+150423,巴林右旗,4,150400
+150424,林西县,4,150400
+150425,克什克腾旗,4,150400
+150426,翁牛特旗,4,150400
+150428,喀喇沁旗,4,150400
+150429,宁城县,4,150400
+150430,敖汉旗,4,150400
+150502,科尔沁区,4,150500
+150521,科尔沁左翼中旗,4,150500
+150522,科尔沁左翼后旗,4,150500
+150523,开鲁县,4,150500
+150524,库伦旗,4,150500
+150525,奈曼旗,4,150500
+150526,扎鲁特旗,4,150500
+150571,通辽经济技术开发区,4,150500
+150581,霍林郭勒市,4,150500
+150602,东胜区,4,150600
+150603,康巴什区,4,150600
+150621,达拉特旗,4,150600
+150622,准格尔旗,4,150600
+150623,鄂托克前旗,4,150600
+150624,鄂托克旗,4,150600
+150625,杭锦旗,4,150600
+150626,乌审旗,4,150600
+150627,伊金霍洛旗,4,150600
+150702,海拉尔区,4,150700
+150703,扎赉诺尔区,4,150700
+150721,阿荣旗,4,150700
+150722,莫力达瓦达斡尔族自治旗,4,150700
+150723,鄂伦春自治旗,4,150700
+150724,鄂温克族自治旗,4,150700
+150725,陈巴尔虎旗,4,150700
+150726,新巴尔虎左旗,4,150700
+150727,新巴尔虎右旗,4,150700
+150781,满洲里市,4,150700
+150782,牙克石市,4,150700
+150783,扎兰屯市,4,150700
+150784,额尔古纳市,4,150700
+150785,根河市,4,150700
+150802,临河区,4,150800
+150821,五原县,4,150800
+150822,磴口县,4,150800
+150823,乌拉特前旗,4,150800
+150824,乌拉特中旗,4,150800
+150825,乌拉特后旗,4,150800
+150826,杭锦后旗,4,150800
+150902,集宁区,4,150900
+150921,卓资县,4,150900
+150922,化德县,4,150900
+150923,商都县,4,150900
+150924,兴和县,4,150900
+150925,凉城县,4,150900
+150926,察哈尔右翼前旗,4,150900
+150927,察哈尔右翼中旗,4,150900
+150928,察哈尔右翼后旗,4,150900
+150929,四子王旗,4,150900
+150981,丰镇市,4,150900
+152201,乌兰浩特市,4,152200
+152202,阿尔山市,4,152200
+152221,科尔沁右翼前旗,4,152200
+152222,科尔沁右翼中旗,4,152200
+152223,扎赉特旗,4,152200
+152224,突泉县,4,152200
+152501,二连浩特市,4,152500
+152502,锡林浩特市,4,152500
+152522,阿巴嘎旗,4,152500
+152523,苏尼特左旗,4,152500
+152524,苏尼特右旗,4,152500
+152525,东乌珠穆沁旗,4,152500
+152526,西乌珠穆沁旗,4,152500
+152527,太仆寺旗,4,152500
+152528,镶黄旗,4,152500
+152529,正镶白旗,4,152500
+152530,正蓝旗,4,152500
+152531,多伦县,4,152500
+152571,乌拉盖管委会,4,152500
+152921,阿拉善左旗,4,152900
+152922,阿拉善右旗,4,152900
+152923,额济纳旗,4,152900
+152971,内蒙古阿拉善高新技术产业开发区,4,152900
+210102,和平区,4,210100
+210103,沈河区,4,210100
+210104,大东区,4,210100
+210105,皇姑区,4,210100
+210106,铁西区,4,210100
+210111,苏家屯区,4,210100
+210112,浑南区,4,210100
+210113,沈北新区,4,210100
+210114,于洪区,4,210100
+210115,辽中区,4,210100
+210123,康平县,4,210100
+210124,法库县,4,210100
+210181,新民市,4,210100
+210202,中山区,4,210200
+210203,西岗区,4,210200
+210204,沙河口区,4,210200
+210211,甘井子区,4,210200
+210212,旅顺口区,4,210200
+210213,金州区,4,210200
+210214,普兰店区,4,210200
+210224,长海县,4,210200
+210281,瓦房店市,4,210200
+210283,庄河市,4,210200
+210302,铁东区,4,210300
+210303,铁西区,4,210300
+210304,立山区,4,210300
+210311,千山区,4,210300
+210321,台安县,4,210300
+210323,岫岩满族自治县,4,210300
+210381,海城市,4,210300
+210402,新抚区,4,210400
+210403,东洲区,4,210400
+210404,望花区,4,210400
+210411,顺城区,4,210400
+210421,抚顺县,4,210400
+210422,新宾满族自治县,4,210400
+210423,清原满族自治县,4,210400
+210502,平山区,4,210500
+210503,溪湖区,4,210500
+210504,明山区,4,210500
+210505,南芬区,4,210500
+210521,本溪满族自治县,4,210500
+210522,桓仁满族自治县,4,210500
+210602,元宝区,4,210600
+210603,振兴区,4,210600
+210604,振安区,4,210600
+210624,宽甸满族自治县,4,210600
+210681,东港市,4,210600
+210682,凤城市,4,210600
+210702,古塔区,4,210700
+210703,凌河区,4,210700
+210711,太和区,4,210700
+210726,黑山县,4,210700
+210727,义县,4,210700
+210781,凌海市,4,210700
+210782,北镇市,4,210700
+210802,站前区,4,210800
+210803,西市区,4,210800
+210804,鲅鱼圈区,4,210800
+210811,老边区,4,210800
+210881,盖州市,4,210800
+210882,大石桥市,4,210800
+210902,海州区,4,210900
+210903,新邱区,4,210900
+210904,太平区,4,210900
+210905,清河门区,4,210900
+210911,细河区,4,210900
+210921,阜新蒙古族自治县,4,210900
+210922,彰武县,4,210900
+211002,白塔区,4,211000
+211003,文圣区,4,211000
+211004,宏伟区,4,211000
+211005,弓长岭区,4,211000
+211011,太子河区,4,211000
+211021,辽阳县,4,211000
+211081,灯塔市,4,211000
+211102,双台子区,4,211100
+211103,兴隆台区,4,211100
+211104,大洼区,4,211100
+211122,盘山县,4,211100
+211202,银州区,4,211200
+211204,清河区,4,211200
+211221,铁岭县,4,211200
+211223,西丰县,4,211200
+211224,昌图县,4,211200
+211281,调兵山市,4,211200
+211282,开原市,4,211200
+211302,双塔区,4,211300
+211303,龙城区,4,211300
+211321,朝阳县,4,211300
+211322,建平县,4,211300
+211324,喀喇沁左翼蒙古族自治县,4,211300
+211381,北票市,4,211300
+211382,凌源市,4,211300
+211402,连山区,4,211400
+211403,龙港区,4,211400
+211404,南票区,4,211400
+211421,绥中县,4,211400
+211422,建昌县,4,211400
+211481,兴城市,4,211400
+220102,南关区,4,220100
+220103,宽城区,4,220100
+220104,朝阳区,4,220100
+220105,二道区,4,220100
+220106,绿园区,4,220100
+220112,双阳区,4,220100
+220113,九台区,4,220100
+220122,农安县,4,220100
+220171,长春经济技术开发区,4,220100
+220172,长春净月高新技术产业开发区,4,220100
+220173,长春高新技术产业开发区,4,220100
+220174,长春汽车经济技术开发区,4,220100
+220182,榆树市,4,220100
+220183,德惠市,4,220100
+220184,公主岭市,4,220100
+220202,昌邑区,4,220200
+220203,龙潭区,4,220200
+220204,船营区,4,220200
+220211,丰满区,4,220200
+220221,永吉县,4,220200
+220271,吉林经济开发区,4,220200
+220272,吉林高新技术产业开发区,4,220200
+220273,吉林中国新加坡食品区,4,220200
+220281,蛟河市,4,220200
+220282,桦甸市,4,220200
+220283,舒兰市,4,220200
+220284,磐石市,4,220200
+220302,铁西区,4,220300
+220303,铁东区,4,220300
+220322,梨树县,4,220300
+220323,伊通满族自治县,4,220300
+220382,双辽市,4,220300
+220402,龙山区,4,220400
+220403,西安区,4,220400
+220421,东丰县,4,220400
+220422,东辽县,4,220400
+220502,东昌区,4,220500
+220503,二道江区,4,220500
+220521,通化县,4,220500
+220523,辉南县,4,220500
+220524,柳河县,4,220500
+220581,梅河口市,4,220500
+220582,集安市,4,220500
+220602,浑江区,4,220600
+220605,江源区,4,220600
+220621,抚松县,4,220600
+220622,靖宇县,4,220600
+220623,长白朝鲜族自治县,4,220600
+220681,临江市,4,220600
+220702,宁江区,4,220700
+220721,前郭尔罗斯蒙古族自治县,4,220700
+220722,长岭县,4,220700
+220723,乾安县,4,220700
+220771,吉林松原经济开发区,4,220700
+220781,扶余市,4,220700
+220802,洮北区,4,220800
+220821,镇赉县,4,220800
+220822,通榆县,4,220800
+220871,吉林白城经济开发区,4,220800
+220881,洮南市,4,220800
+220882,大安市,4,220800
+222401,延吉市,4,222400
+222402,图们市,4,222400
+222403,敦化市,4,222400
+222404,珲春市,4,222400
+222405,龙井市,4,222400
+222406,和龙市,4,222400
+222424,汪清县,4,222400
+222426,安图县,4,222400
+230102,道里区,4,230100
+230103,南岗区,4,230100
+230104,道外区,4,230100
+230108,平房区,4,230100
+230109,松北区,4,230100
+230110,香坊区,4,230100
+230111,呼兰区,4,230100
+230112,阿城区,4,230100
+230113,双城区,4,230100
+230123,依兰县,4,230100
+230124,方正县,4,230100
+230125,宾县,4,230100
+230126,巴彦县,4,230100
+230127,木兰县,4,230100
+230128,通河县,4,230100
+230129,延寿县,4,230100
+230183,尚志市,4,230100
+230184,五常市,4,230100
+230202,龙沙区,4,230200
+230203,建华区,4,230200
+230204,铁锋区,4,230200
+230205,昂昂溪区,4,230200
+230206,富拉尔基区,4,230200
+230207,碾子山区,4,230200
+230208,梅里斯达斡尔族区,4,230200
+230221,龙江县,4,230200
+230223,依安县,4,230200
+230224,泰来县,4,230200
+230225,甘南县,4,230200
+230227,富裕县,4,230200
+230229,克山县,4,230200
+230230,克东县,4,230200
+230231,拜泉县,4,230200
+230281,讷河市,4,230200
+230302,鸡冠区,4,230300
+230303,恒山区,4,230300
+230304,滴道区,4,230300
+230305,梨树区,4,230300
+230306,城子河区,4,230300
+230307,麻山区,4,230300
+230321,鸡东县,4,230300
+230381,虎林市,4,230300
+230382,密山市,4,230300
+230402,向阳区,4,230400
+230403,工农区,4,230400
+230404,南山区,4,230400
+230405,兴安区,4,230400
+230406,东山区,4,230400
+230407,兴山区,4,230400
+230421,萝北县,4,230400
+230422,绥滨县,4,230400
+230502,尖山区,4,230500
+230503,岭东区,4,230500
+230505,四方台区,4,230500
+230506,宝山区,4,230500
+230521,集贤县,4,230500
+230522,友谊县,4,230500
+230523,宝清县,4,230500
+230524,饶河县,4,230500
+230602,萨尔图区,4,230600
+230603,龙凤区,4,230600
+230604,让胡路区,4,230600
+230605,红岗区,4,230600
+230606,大同区,4,230600
+230621,肇州县,4,230600
+230622,肇源县,4,230600
+230623,林甸县,4,230600
+230624,杜尔伯特蒙古族自治县,4,230600
+230671,大庆高新技术产业开发区,4,230600
+230717,伊美区,4,230700
+230718,乌翠区,4,230700
+230719,友好区,4,230700
+230722,嘉荫县,4,230700
+230723,汤旺县,4,230700
+230724,丰林县,4,230700
+230725,大箐山县,4,230700
+230726,南岔县,4,230700
+230751,金林区,4,230700
+230781,铁力市,4,230700
+230803,向阳区,4,230800
+230804,前进区,4,230800
+230805,东风区,4,230800
+230811,郊区,4,230800
+230822,桦南县,4,230800
+230826,桦川县,4,230800
+230828,汤原县,4,230800
+230881,同江市,4,230800
+230882,富锦市,4,230800
+230883,抚远市,4,230800
+230902,新兴区,4,230900
+230903,桃山区,4,230900
+230904,茄子河区,4,230900
+230921,勃利县,4,230900
+231002,东安区,4,231000
+231003,阳明区,4,231000
+231004,爱民区,4,231000
+231005,西安区,4,231000
+231025,林口县,4,231000
+231071,牡丹江经济技术开发区,4,231000
+231081,绥芬河市,4,231000
+231083,海林市,4,231000
+231084,宁安市,4,231000
+231085,穆棱市,4,231000
+231086,东宁市,4,231000
+231102,爱辉区,4,231100
+231123,逊克县,4,231100
+231124,孙吴县,4,231100
+231181,北安市,4,231100
+231182,五大连池市,4,231100
+231183,嫩江市,4,231100
+231202,北林区,4,231200
+231221,望奎县,4,231200
+231222,兰西县,4,231200
+231223,青冈县,4,231200
+231224,庆安县,4,231200
+231225,明水县,4,231200
+231226,绥棱县,4,231200
+231281,安达市,4,231200
+231282,肇东市,4,231200
+231283,海伦市,4,231200
+232701,漠河市,4,232700
+232721,呼玛县,4,232700
+232722,塔河县,4,232700
+232761,加格达奇区,4,232700
+232762,松岭区,4,232700
+232763,新林区,4,232700
+232764,呼中区,4,232700
+310101,黄浦区,4,310100
+310104,徐汇区,4,310100
+310105,长宁区,4,310100
+310106,静安区,4,310100
+310107,普陀区,4,310100
+310109,虹口区,4,310100
+310110,杨浦区,4,310100
+310112,闵行区,4,310100
+310113,宝山区,4,310100
+310114,嘉定区,4,310100
+310115,浦东新区,4,310100
+310116,金山区,4,310100
+310117,松江区,4,310100
+310118,青浦区,4,310100
+310120,奉贤区,4,310100
+310151,崇明区,4,310100
+320102,玄武区,4,320100
+320104,秦淮区,4,320100
+320105,建邺区,4,320100
+320106,鼓楼区,4,320100
+320111,浦口区,4,320100
+320113,栖霞区,4,320100
+320114,雨花台区,4,320100
+320115,江宁区,4,320100
+320116,六合区,4,320100
+320117,溧水区,4,320100
+320118,高淳区,4,320100
+320205,锡山区,4,320200
+320206,惠山区,4,320200
+320211,滨湖区,4,320200
+320213,梁溪区,4,320200
+320214,新吴区,4,320200
+320281,江阴市,4,320200
+320282,宜兴市,4,320200
+320302,鼓楼区,4,320300
+320303,云龙区,4,320300
+320305,贾汪区,4,320300
+320311,泉山区,4,320300
+320312,铜山区,4,320300
+320321,丰县,4,320300
+320322,沛县,4,320300
+320324,睢宁县,4,320300
+320371,徐州经济技术开发区,4,320300
+320381,新沂市,4,320300
+320382,邳州市,4,320300
+320402,天宁区,4,320400
+320404,钟楼区,4,320400
+320411,新北区,4,320400
+320412,武进区,4,320400
+320413,金坛区,4,320400
+320481,溧阳市,4,320400
+320505,虎丘区,4,320500
+320506,吴中区,4,320500
+320507,相城区,4,320500
+320508,姑苏区,4,320500
+320509,吴江区,4,320500
+320571,苏州工业园区,4,320500
+320581,常熟市,4,320500
+320582,张家港市,4,320500
+320583,昆山市,4,320500
+320585,太仓市,4,320500
+320612,通州区,4,320600
+320613,崇川区,4,320600
+320614,海门区,4,320600
+320623,如东县,4,320600
+320671,南通经济技术开发区,4,320600
+320681,启东市,4,320600
+320682,如皋市,4,320600
+320685,海安市,4,320600
+320703,连云区,4,320700
+320706,海州区,4,320700
+320707,赣榆区,4,320700
+320722,东海县,4,320700
+320723,灌云县,4,320700
+320724,灌南县,4,320700
+320771,连云港经济技术开发区,4,320700
+320772,连云港高新技术产业开发区,4,320700
+320803,淮安区,4,320800
+320804,淮阴区,4,320800
+320812,清江浦区,4,320800
+320813,洪泽区,4,320800
+320826,涟水县,4,320800
+320830,盱眙县,4,320800
+320831,金湖县,4,320800
+320871,淮安经济技术开发区,4,320800
+320902,亭湖区,4,320900
+320903,盐都区,4,320900
+320904,大丰区,4,320900
+320921,响水县,4,320900
+320922,滨海县,4,320900
+320923,阜宁县,4,320900
+320924,射阳县,4,320900
+320925,建湖县,4,320900
+320971,盐城经济技术开发区,4,320900
+320981,东台市,4,320900
+321002,广陵区,4,321000
+321003,邗江区,4,321000
+321012,江都区,4,321000
+321023,宝应县,4,321000
+321071,扬州经济技术开发区,4,321000
+321081,仪征市,4,321000
+321084,高邮市,4,321000
+321102,京口区,4,321100
+321111,润州区,4,321100
+321112,丹徒区,4,321100
+321171,镇江新区,4,321100
+321181,丹阳市,4,321100
+321182,扬中市,4,321100
+321183,句容市,4,321100
+321202,海陵区,4,321200
+321203,高港区,4,321200
+321204,姜堰区,4,321200
+321271,泰州医药高新技术产业开发区,4,321200
+321281,兴化市,4,321200
+321282,靖江市,4,321200
+321283,泰兴市,4,321200
+321302,宿城区,4,321300
+321311,宿豫区,4,321300
+321322,沭阳县,4,321300
+321323,泗阳县,4,321300
+321324,泗洪县,4,321300
+321371,宿迁经济技术开发区,4,321300
+330102,上城区,4,330100
+330105,拱墅区,4,330100
+330106,西湖区,4,330100
+330108,滨江区,4,330100
+330109,萧山区,4,330100
+330110,余杭区,4,330100
+330111,富阳区,4,330100
+330112,临安区,4,330100
+330113,临平区,4,330100
+330114,钱塘区,4,330100
+330122,桐庐县,4,330100
+330127,淳安县,4,330100
+330182,建德市,4,330100
+330203,海曙区,4,330200
+330205,江北区,4,330200
+330206,北仑区,4,330200
+330211,镇海区,4,330200
+330212,鄞州区,4,330200
+330213,奉化区,4,330200
+330225,象山县,4,330200
+330226,宁海县,4,330200
+330281,余姚市,4,330200
+330282,慈溪市,4,330200
+330302,鹿城区,4,330300
+330303,龙湾区,4,330300
+330304,瓯海区,4,330300
+330305,洞头区,4,330300
+330324,永嘉县,4,330300
+330326,平阳县,4,330300
+330327,苍南县,4,330300
+330328,文成县,4,330300
+330329,泰顺县,4,330300
+330371,温州经济技术开发区,4,330300
+330381,瑞安市,4,330300
+330382,乐清市,4,330300
+330383,龙港市,4,330300
+330402,南湖区,4,330400
+330411,秀洲区,4,330400
+330421,嘉善县,4,330400
+330424,海盐县,4,330400
+330481,海宁市,4,330400
+330482,平湖市,4,330400
+330483,桐乡市,4,330400
+330502,吴兴区,4,330500
+330503,南浔区,4,330500
+330521,德清县,4,330500
+330522,长兴县,4,330500
+330523,安吉县,4,330500
+330602,越城区,4,330600
+330603,柯桥区,4,330600
+330604,上虞区,4,330600
+330624,新昌县,4,330600
+330681,诸暨市,4,330600
+330683,嵊州市,4,330600
+330702,婺城区,4,330700
+330703,金东区,4,330700
+330723,武义县,4,330700
+330726,浦江县,4,330700
+330727,磐安县,4,330700
+330781,兰溪市,4,330700
+330782,义乌市,4,330700
+330783,东阳市,4,330700
+330784,永康市,4,330700
+330802,柯城区,4,330800
+330803,衢江区,4,330800
+330822,常山县,4,330800
+330824,开化县,4,330800
+330825,龙游县,4,330800
+330881,江山市,4,330800
+330902,定海区,4,330900
+330903,普陀区,4,330900
+330921,岱山县,4,330900
+330922,嵊泗县,4,330900
+331002,椒江区,4,331000
+331003,黄岩区,4,331000
+331004,路桥区,4,331000
+331022,三门县,4,331000
+331023,天台县,4,331000
+331024,仙居县,4,331000
+331081,温岭市,4,331000
+331082,临海市,4,331000
+331083,玉环市,4,331000
+331102,莲都区,4,331100
+331121,青田县,4,331100
+331122,缙云县,4,331100
+331123,遂昌县,4,331100
+331124,松阳县,4,331100
+331125,云和县,4,331100
+331126,庆元县,4,331100
+331127,景宁畲族自治县,4,331100
+331181,龙泉市,4,331100
+340102,瑶海区,4,340100
+340103,庐阳区,4,340100
+340104,蜀山区,4,340100
+340111,包河区,4,340100
+340121,长丰县,4,340100
+340122,肥东县,4,340100
+340123,肥西县,4,340100
+340124,庐江县,4,340100
+340171,合肥高新技术产业开发区,4,340100
+340172,合肥经济技术开发区,4,340100
+340173,合肥新站高新技术产业开发区,4,340100
+340181,巢湖市,4,340100
+340202,镜湖区,4,340200
+340207,鸠江区,4,340200
+340209,弋江区,4,340200
+340210,湾沚区,4,340200
+340212,繁昌区,4,340200
+340223,南陵县,4,340200
+340271,芜湖经济技术开发区,4,340200
+340272,安徽芜湖三山经济开发区,4,340200
+340281,无为市,4,340200
+340302,龙子湖区,4,340300
+340303,蚌山区,4,340300
+340304,禹会区,4,340300
+340311,淮上区,4,340300
+340321,怀远县,4,340300
+340322,五河县,4,340300
+340323,固镇县,4,340300
+340371,蚌埠市高新技术开发区,4,340300
+340372,蚌埠市经济开发区,4,340300
+340402,大通区,4,340400
+340403,田家庵区,4,340400
+340404,谢家集区,4,340400
+340405,八公山区,4,340400
+340406,潘集区,4,340400
+340421,凤台县,4,340400
+340422,寿县,4,340400
+340503,花山区,4,340500
+340504,雨山区,4,340500
+340506,博望区,4,340500
+340521,当涂县,4,340500
+340522,含山县,4,340500
+340523,和县,4,340500
+340602,杜集区,4,340600
+340603,相山区,4,340600
+340604,烈山区,4,340600
+340621,濉溪县,4,340600
+340705,铜官区,4,340700
+340706,义安区,4,340700
+340711,郊区,4,340700
+340722,枞阳县,4,340700
+340802,迎江区,4,340800
+340803,大观区,4,340800
+340811,宜秀区,4,340800
+340822,怀宁县,4,340800
+340825,太湖县,4,340800
+340826,宿松县,4,340800
+340827,望江县,4,340800
+340828,岳西县,4,340800
+340871,安徽安庆经济开发区,4,340800
+340881,桐城市,4,340800
+340882,潜山市,4,340800
+341002,屯溪区,4,341000
+341003,黄山区,4,341000
+341004,徽州区,4,341000
+341021,歙县,4,341000
+341022,休宁县,4,341000
+341023,黟县,4,341000
+341024,祁门县,4,341000
+341102,琅琊区,4,341100
+341103,南谯区,4,341100
+341122,来安县,4,341100
+341124,全椒县,4,341100
+341125,定远县,4,341100
+341126,凤阳县,4,341100
+341171,中新苏滁高新技术产业开发区,4,341100
+341172,滁州经济技术开发区,4,341100
+341181,天长市,4,341100
+341182,明光市,4,341100
+341202,颍州区,4,341200
+341203,颍东区,4,341200
+341204,颍泉区,4,341200
+341221,临泉县,4,341200
+341222,太和县,4,341200
+341225,阜南县,4,341200
+341226,颍上县,4,341200
+341271,阜阳合肥现代产业园区,4,341200
+341272,阜阳经济技术开发区,4,341200
+341282,界首市,4,341200
+341302,埇桥区,4,341300
+341321,砀山县,4,341300
+341322,萧县,4,341300
+341323,灵璧县,4,341300
+341324,泗县,4,341300
+341371,宿州马鞍山现代产业园区,4,341300
+341372,宿州经济技术开发区,4,341300
+341502,金安区,4,341500
+341503,裕安区,4,341500
+341504,叶集区,4,341500
+341522,霍邱县,4,341500
+341523,舒城县,4,341500
+341524,金寨县,4,341500
+341525,霍山县,4,341500
+341602,谯城区,4,341600
+341621,涡阳县,4,341600
+341622,蒙城县,4,341600
+341623,利辛县,4,341600
+341702,贵池区,4,341700
+341721,东至县,4,341700
+341722,石台县,4,341700
+341723,青阳县,4,341700
+341802,宣州区,4,341800
+341821,郎溪县,4,341800
+341823,泾县,4,341800
+341824,绩溪县,4,341800
+341825,旌德县,4,341800
+341871,宣城市经济开发区,4,341800
+341881,宁国市,4,341800
+341882,广德市,4,341800
+350102,鼓楼区,4,350100
+350103,台江区,4,350100
+350104,仓山区,4,350100
+350105,马尾区,4,350100
+350111,晋安区,4,350100
+350112,长乐区,4,350100
+350121,闽侯县,4,350100
+350122,连江县,4,350100
+350123,罗源县,4,350100
+350124,闽清县,4,350100
+350125,永泰县,4,350100
+350128,平潭县,4,350100
+350181,福清市,4,350100
+350203,思明区,4,350200
+350205,海沧区,4,350200
+350206,湖里区,4,350200
+350211,集美区,4,350200
+350212,同安区,4,350200
+350213,翔安区,4,350200
+350302,城厢区,4,350300
+350303,涵江区,4,350300
+350304,荔城区,4,350300
+350305,秀屿区,4,350300
+350322,仙游县,4,350300
+350404,三元区,4,350400
+350405,沙县区,4,350400
+350421,明溪县,4,350400
+350423,清流县,4,350400
+350424,宁化县,4,350400
+350425,大田县,4,350400
+350426,尤溪县,4,350400
+350428,将乐县,4,350400
+350429,泰宁县,4,350400
+350430,建宁县,4,350400
+350481,永安市,4,350400
+350502,鲤城区,4,350500
+350503,丰泽区,4,350500
+350504,洛江区,4,350500
+350505,泉港区,4,350500
+350521,惠安县,4,350500
+350524,安溪县,4,350500
+350525,永春县,4,350500
+350526,德化县,4,350500
+350527,金门县,4,350500
+350581,石狮市,4,350500
+350582,晋江市,4,350500
+350583,南安市,4,350500
+350602,芗城区,4,350600
+350603,龙文区,4,350600
+350604,龙海区,4,350600
+350605,长泰区,4,350600
+350622,云霄县,4,350600
+350623,漳浦县,4,350600
+350624,诏安县,4,350600
+350626,东山县,4,350600
+350627,南靖县,4,350600
+350628,平和县,4,350600
+350629,华安县,4,350600
+350702,延平区,4,350700
+350703,建阳区,4,350700
+350721,顺昌县,4,350700
+350722,浦城县,4,350700
+350723,光泽县,4,350700
+350724,松溪县,4,350700
+350725,政和县,4,350700
+350781,邵武市,4,350700
+350782,武夷山市,4,350700
+350783,建瓯市,4,350700
+350802,新罗区,4,350800
+350803,永定区,4,350800
+350821,长汀县,4,350800
+350823,上杭县,4,350800
+350824,武平县,4,350800
+350825,连城县,4,350800
+350881,漳平市,4,350800
+350902,蕉城区,4,350900
+350921,霞浦县,4,350900
+350922,古田县,4,350900
+350923,屏南县,4,350900
+350924,寿宁县,4,350900
+350925,周宁县,4,350900
+350926,柘荣县,4,350900
+350981,福安市,4,350900
+350982,福鼎市,4,350900
+360102,东湖区,4,360100
+360103,西湖区,4,360100
+360104,青云谱区,4,360100
+360111,青山湖区,4,360100
+360112,新建区,4,360100
+360113,红谷滩区,4,360100
+360121,南昌县,4,360100
+360123,安义县,4,360100
+360124,进贤县,4,360100
+360202,昌江区,4,360200
+360203,珠山区,4,360200
+360222,浮梁县,4,360200
+360281,乐平市,4,360200
+360302,安源区,4,360300
+360313,湘东区,4,360300
+360321,莲花县,4,360300
+360322,上栗县,4,360300
+360323,芦溪县,4,360300
+360402,濂溪区,4,360400
+360403,浔阳区,4,360400
+360404,柴桑区,4,360400
+360423,武宁县,4,360400
+360424,修水县,4,360400
+360425,永修县,4,360400
+360426,德安县,4,360400
+360428,都昌县,4,360400
+360429,湖口县,4,360400
+360430,彭泽县,4,360400
+360481,瑞昌市,4,360400
+360482,共青城市,4,360400
+360483,庐山市,4,360400
+360502,渝水区,4,360500
+360521,分宜县,4,360500
+360602,月湖区,4,360600
+360603,余江区,4,360600
+360681,贵溪市,4,360600
+360702,章贡区,4,360700
+360703,南康区,4,360700
+360704,赣县区,4,360700
+360722,信丰县,4,360700
+360723,大余县,4,360700
+360724,上犹县,4,360700
+360725,崇义县,4,360700
+360726,安远县,4,360700
+360728,定南县,4,360700
+360729,全南县,4,360700
+360730,宁都县,4,360700
+360731,于都县,4,360700
+360732,兴国县,4,360700
+360733,会昌县,4,360700
+360734,寻乌县,4,360700
+360735,石城县,4,360700
+360781,瑞金市,4,360700
+360783,龙南市,4,360700
+360802,吉州区,4,360800
+360803,青原区,4,360800
+360821,吉安县,4,360800
+360822,吉水县,4,360800
+360823,峡江县,4,360800
+360824,新干县,4,360800
+360825,永丰县,4,360800
+360826,泰和县,4,360800
+360827,遂川县,4,360800
+360828,万安县,4,360800
+360829,安福县,4,360800
+360830,永新县,4,360800
+360881,井冈山市,4,360800
+360902,袁州区,4,360900
+360921,奉新县,4,360900
+360922,万载县,4,360900
+360923,上高县,4,360900
+360924,宜丰县,4,360900
+360925,靖安县,4,360900
+360926,铜鼓县,4,360900
+360981,丰城市,4,360900
+360982,樟树市,4,360900
+360983,高安市,4,360900
+361002,临川区,4,361000
+361003,东乡区,4,361000
+361021,南城县,4,361000
+361022,黎川县,4,361000
+361023,南丰县,4,361000
+361024,崇仁县,4,361000
+361025,乐安县,4,361000
+361026,宜黄县,4,361000
+361027,金溪县,4,361000
+361028,资溪县,4,361000
+361030,广昌县,4,361000
+361102,信州区,4,361100
+361103,广丰区,4,361100
+361104,广信区,4,361100
+361123,玉山县,4,361100
+361124,铅山县,4,361100
+361125,横峰县,4,361100
+361126,弋阳县,4,361100
+361127,余干县,4,361100
+361128,鄱阳县,4,361100
+361129,万年县,4,361100
+361130,婺源县,4,361100
+361181,德兴市,4,361100
+370102,历下区,4,370100
+370103,市中区,4,370100
+370104,槐荫区,4,370100
+370105,天桥区,4,370100
+370112,历城区,4,370100
+370113,长清区,4,370100
+370114,章丘区,4,370100
+370115,济阳区,4,370100
+370116,莱芜区,4,370100
+370117,钢城区,4,370100
+370124,平阴县,4,370100
+370126,商河县,4,370100
+370171,济南高新技术产业开发区,4,370100
+370202,市南区,4,370200
+370203,市北区,4,370200
+370211,黄岛区,4,370200
+370212,崂山区,4,370200
+370213,李沧区,4,370200
+370214,城阳区,4,370200
+370215,即墨区,4,370200
+370271,青岛高新技术产业开发区,4,370200
+370281,胶州市,4,370200
+370283,平度市,4,370200
+370285,莱西市,4,370200
+370302,淄川区,4,370300
+370303,张店区,4,370300
+370304,博山区,4,370300
+370305,临淄区,4,370300
+370306,周村区,4,370300
+370321,桓台县,4,370300
+370322,高青县,4,370300
+370323,沂源县,4,370300
+370402,市中区,4,370400
+370403,薛城区,4,370400
+370404,峄城区,4,370400
+370405,台儿庄区,4,370400
+370406,山亭区,4,370400
+370481,滕州市,4,370400
+370502,东营区,4,370500
+370503,河口区,4,370500
+370505,垦利区,4,370500
+370522,利津县,4,370500
+370523,广饶县,4,370500
+370571,东营经济技术开发区,4,370500
+370572,东营港经济开发区,4,370500
+370602,芝罘区,4,370600
+370611,福山区,4,370600
+370612,牟平区,4,370600
+370613,莱山区,4,370600
+370614,蓬莱区,4,370600
+370671,烟台高新技术产业开发区,4,370600
+370672,烟台经济技术开发区,4,370600
+370681,龙口市,4,370600
+370682,莱阳市,4,370600
+370683,莱州市,4,370600
+370685,招远市,4,370600
+370686,栖霞市,4,370600
+370687,海阳市,4,370600
+370702,潍城区,4,370700
+370703,寒亭区,4,370700
+370704,坊子区,4,370700
+370705,奎文区,4,370700
+370724,临朐县,4,370700
+370725,昌乐县,4,370700
+370772,潍坊滨海经济技术开发区,4,370700
+370781,青州市,4,370700
+370782,诸城市,4,370700
+370783,寿光市,4,370700
+370784,安丘市,4,370700
+370785,高密市,4,370700
+370786,昌邑市,4,370700
+370811,任城区,4,370800
+370812,兖州区,4,370800
+370826,微山县,4,370800
+370827,鱼台县,4,370800
+370828,金乡县,4,370800
+370829,嘉祥县,4,370800
+370830,汶上县,4,370800
+370831,泗水县,4,370800
+370832,梁山县,4,370800
+370871,济宁高新技术产业开发区,4,370800
+370881,曲阜市,4,370800
+370883,邹城市,4,370800
+370902,泰山区,4,370900
+370911,岱岳区,4,370900
+370921,宁阳县,4,370900
+370923,东平县,4,370900
+370982,新泰市,4,370900
+370983,肥城市,4,370900
+371002,环翠区,4,371000
+371003,文登区,4,371000
+371071,威海火炬高技术产业开发区,4,371000
+371072,威海经济技术开发区,4,371000
+371073,威海临港经济技术开发区,4,371000
+371082,荣成市,4,371000
+371083,乳山市,4,371000
+371102,东港区,4,371100
+371103,岚山区,4,371100
+371121,五莲县,4,371100
+371122,莒县,4,371100
+371171,日照经济技术开发区,4,371100
+371302,兰山区,4,371300
+371311,罗庄区,4,371300
+371312,河东区,4,371300
+371321,沂南县,4,371300
+371322,郯城县,4,371300
+371323,沂水县,4,371300
+371324,兰陵县,4,371300
+371325,费县,4,371300
+371326,平邑县,4,371300
+371327,莒南县,4,371300
+371328,蒙阴县,4,371300
+371329,临沭县,4,371300
+371371,临沂高新技术产业开发区,4,371300
+371402,德城区,4,371400
+371403,陵城区,4,371400
+371422,宁津县,4,371400
+371423,庆云县,4,371400
+371424,临邑县,4,371400
+371425,齐河县,4,371400
+371426,平原县,4,371400
+371427,夏津县,4,371400
+371428,武城县,4,371400
+371471,德州经济技术开发区,4,371400
+371472,德州运河经济开发区,4,371400
+371481,乐陵市,4,371400
+371482,禹城市,4,371400
+371502,东昌府区,4,371500
+371503,茌平区,4,371500
+371521,阳谷县,4,371500
+371522,莘县,4,371500
+371524,东阿县,4,371500
+371525,冠县,4,371500
+371526,高唐县,4,371500
+371581,临清市,4,371500
+371602,滨城区,4,371600
+371603,沾化区,4,371600
+371621,惠民县,4,371600
+371622,阳信县,4,371600
+371623,无棣县,4,371600
+371625,博兴县,4,371600
+371681,邹平市,4,371600
+371702,牡丹区,4,371700
+371703,定陶区,4,371700
+371721,曹县,4,371700
+371722,单县,4,371700
+371723,成武县,4,371700
+371724,巨野县,4,371700
+371725,郓城县,4,371700
+371726,鄄城县,4,371700
+371728,东明县,4,371700
+371771,菏泽经济技术开发区,4,371700
+371772,菏泽高新技术开发区,4,371700
+410102,中原区,4,410100
+410103,二七区,4,410100
+410104,管城回族区,4,410100
+410105,金水区,4,410100
+410106,上街区,4,410100
+410108,惠济区,4,410100
+410122,中牟县,4,410100
+410171,郑州经济技术开发区,4,410100
+410172,郑州高新技术产业开发区,4,410100
+410173,郑州航空港经济综合实验区,4,410100
+410181,巩义市,4,410100
+410182,荥阳市,4,410100
+410183,新密市,4,410100
+410184,新郑市,4,410100
+410185,登封市,4,410100
+410202,龙亭区,4,410200
+410203,顺河回族区,4,410200
+410204,鼓楼区,4,410200
+410205,禹王台区,4,410200
+410212,祥符区,4,410200
+410221,杞县,4,410200
+410222,通许县,4,410200
+410223,尉氏县,4,410200
+410225,兰考县,4,410200
+410302,老城区,4,410300
+410303,西工区,4,410300
+410304,瀍河回族区,4,410300
+410305,涧西区,4,410300
+410307,偃师区,4,410300
+410308,孟津区,4,410300
+410311,洛龙区,4,410300
+410323,新安县,4,410300
+410324,栾川县,4,410300
+410325,嵩县,4,410300
+410326,汝阳县,4,410300
+410327,宜阳县,4,410300
+410328,洛宁县,4,410300
+410329,伊川县,4,410300
+410371,洛阳高新技术产业开发区,4,410300
+410402,新华区,4,410400
+410403,卫东区,4,410400
+410404,石龙区,4,410400
+410411,湛河区,4,410400
+410421,宝丰县,4,410400
+410422,叶县,4,410400
+410423,鲁山县,4,410400
+410425,郏县,4,410400
+410471,平顶山高新技术产业开发区,4,410400
+410472,平顶山市城乡一体化示范区,4,410400
+410481,舞钢市,4,410400
+410482,汝州市,4,410400
+410502,文峰区,4,410500
+410503,北关区,4,410500
+410505,殷都区,4,410500
+410506,龙安区,4,410500
+410522,安阳县,4,410500
+410523,汤阴县,4,410500
+410526,滑县,4,410500
+410527,内黄县,4,410500
+410571,安阳高新技术产业开发区,4,410500
+410581,林州市,4,410500
+410602,鹤山区,4,410600
+410603,山城区,4,410600
+410611,淇滨区,4,410600
+410621,浚县,4,410600
+410622,淇县,4,410600
+410671,鹤壁经济技术开发区,4,410600
+410702,红旗区,4,410700
+410703,卫滨区,4,410700
+410704,凤泉区,4,410700
+410711,牧野区,4,410700
+410721,新乡县,4,410700
+410724,获嘉县,4,410700
+410725,原阳县,4,410700
+410726,延津县,4,410700
+410727,封丘县,4,410700
+410771,新乡高新技术产业开发区,4,410700
+410772,新乡经济技术开发区,4,410700
+410773,新乡市平原城乡一体化示范区,4,410700
+410781,卫辉市,4,410700
+410782,辉县市,4,410700
+410783,长垣市,4,410700
+410802,解放区,4,410800
+410803,中站区,4,410800
+410804,马村区,4,410800
+410811,山阳区,4,410800
+410821,修武县,4,410800
+410822,博爱县,4,410800
+410823,武陟县,4,410800
+410825,温县,4,410800
+410871,焦作城乡一体化示范区,4,410800
+410882,沁阳市,4,410800
+410883,孟州市,4,410800
+410902,华龙区,4,410900
+410922,清丰县,4,410900
+410923,南乐县,4,410900
+410926,范县,4,410900
+410927,台前县,4,410900
+410928,濮阳县,4,410900
+410971,河南濮阳工业园区,4,410900
+410972,濮阳经济技术开发区,4,410900
+411002,魏都区,4,411000
+411003,建安区,4,411000
+411024,鄢陵县,4,411000
+411025,襄城县,4,411000
+411071,许昌经济技术开发区,4,411000
+411081,禹州市,4,411000
+411082,长葛市,4,411000
+411102,源汇区,4,411100
+411103,郾城区,4,411100
+411104,召陵区,4,411100
+411121,舞阳县,4,411100
+411122,临颍县,4,411100
+411171,漯河经济技术开发区,4,411100
+411202,湖滨区,4,411200
+411203,陕州区,4,411200
+411221,渑池县,4,411200
+411224,卢氏县,4,411200
+411271,河南三门峡经济开发区,4,411200
+411281,义马市,4,411200
+411282,灵宝市,4,411200
+411302,宛城区,4,411300
+411303,卧龙区,4,411300
+411321,南召县,4,411300
+411322,方城县,4,411300
+411323,西峡县,4,411300
+411324,镇平县,4,411300
+411325,内乡县,4,411300
+411326,淅川县,4,411300
+411327,社旗县,4,411300
+411328,唐河县,4,411300
+411329,新野县,4,411300
+411330,桐柏县,4,411300
+411371,南阳高新技术产业开发区,4,411300
+411372,南阳市城乡一体化示范区,4,411300
+411381,邓州市,4,411300
+411402,梁园区,4,411400
+411403,睢阳区,4,411400
+411421,民权县,4,411400
+411422,睢县,4,411400
+411423,宁陵县,4,411400
+411424,柘城县,4,411400
+411425,虞城县,4,411400
+411426,夏邑县,4,411400
+411471,豫东综合物流产业聚集区,4,411400
+411472,河南商丘经济开发区,4,411400
+411481,永城市,4,411400
+411502,浉河区,4,411500
+411503,平桥区,4,411500
+411521,罗山县,4,411500
+411522,光山县,4,411500
+411523,新县,4,411500
+411524,商城县,4,411500
+411525,固始县,4,411500
+411526,潢川县,4,411500
+411527,淮滨县,4,411500
+411528,息县,4,411500
+411571,信阳高新技术产业开发区,4,411500
+411602,川汇区,4,411600
+411603,淮阳区,4,411600
+411621,扶沟县,4,411600
+411622,西华县,4,411600
+411623,商水县,4,411600
+411624,沈丘县,4,411600
+411625,郸城县,4,411600
+411627,太康县,4,411600
+411628,鹿邑县,4,411600
+411671,河南周口经济开发区,4,411600
+411681,项城市,4,411600
+411702,驿城区,4,411700
+411721,西平县,4,411700
+411722,上蔡县,4,411700
+411723,平舆县,4,411700
+411724,正阳县,4,411700
+411725,确山县,4,411700
+411726,泌阳县,4,411700
+411727,汝南县,4,411700
+411728,遂平县,4,411700
+411729,新蔡县,4,411700
+411771,河南驻马店经济开发区,4,411700
+419001,济源市,4,419000
+420102,江岸区,4,420100
+420103,江汉区,4,420100
+420104,硚口区,4,420100
+420105,汉阳区,4,420100
+420106,武昌区,4,420100
+420107,青山区,4,420100
+420111,洪山区,4,420100
+420112,东西湖区,4,420100
+420113,汉南区,4,420100
+420114,蔡甸区,4,420100
+420115,江夏区,4,420100
+420116,黄陂区,4,420100
+420117,新洲区,4,420100
+420202,黄石港区,4,420200
+420203,西塞山区,4,420200
+420204,下陆区,4,420200
+420205,铁山区,4,420200
+420222,阳新县,4,420200
+420281,大冶市,4,420200
+420302,茅箭区,4,420300
+420303,张湾区,4,420300
+420304,郧阳区,4,420300
+420322,郧西县,4,420300
+420323,竹山县,4,420300
+420324,竹溪县,4,420300
+420325,房县,4,420300
+420381,丹江口市,4,420300
+420502,西陵区,4,420500
+420503,伍家岗区,4,420500
+420504,点军区,4,420500
+420505,猇亭区,4,420500
+420506,夷陵区,4,420500
+420525,远安县,4,420500
+420526,兴山县,4,420500
+420527,秭归县,4,420500
+420528,长阳土家族自治县,4,420500
+420529,五峰土家族自治县,4,420500
+420581,宜都市,4,420500
+420582,当阳市,4,420500
+420583,枝江市,4,420500
+420602,襄城区,4,420600
+420606,樊城区,4,420600
+420607,襄州区,4,420600
+420624,南漳县,4,420600
+420625,谷城县,4,420600
+420626,保康县,4,420600
+420682,老河口市,4,420600
+420683,枣阳市,4,420600
+420684,宜城市,4,420600
+420702,梁子湖区,4,420700
+420703,华容区,4,420700
+420704,鄂城区,4,420700
+420802,东宝区,4,420800
+420804,掇刀区,4,420800
+420822,沙洋县,4,420800
+420881,钟祥市,4,420800
+420882,京山市,4,420800
+420902,孝南区,4,420900
+420921,孝昌县,4,420900
+420922,大悟县,4,420900
+420923,云梦县,4,420900
+420981,应城市,4,420900
+420982,安陆市,4,420900
+420984,汉川市,4,420900
+421002,沙市区,4,421000
+421003,荆州区,4,421000
+421022,公安县,4,421000
+421024,江陵县,4,421000
+421071,荆州经济技术开发区,4,421000
+421081,石首市,4,421000
+421083,洪湖市,4,421000
+421087,松滋市,4,421000
+421088,监利市,4,421000
+421102,黄州区,4,421100
+421121,团风县,4,421100
+421122,红安县,4,421100
+421123,罗田县,4,421100
+421124,英山县,4,421100
+421125,浠水县,4,421100
+421126,蕲春县,4,421100
+421127,黄梅县,4,421100
+421171,龙感湖管理区,4,421100
+421181,麻城市,4,421100
+421182,武穴市,4,421100
+421202,咸安区,4,421200
+421221,嘉鱼县,4,421200
+421222,通城县,4,421200
+421223,崇阳县,4,421200
+421224,通山县,4,421200
+421281,赤壁市,4,421200
+421303,曾都区,4,421300
+421321,随县,4,421300
+421381,广水市,4,421300
+422801,恩施市,4,422800
+422802,利川市,4,422800
+422822,建始县,4,422800
+422823,巴东县,4,422800
+422825,宣恩县,4,422800
+422826,咸丰县,4,422800
+422827,来凤县,4,422800
+422828,鹤峰县,4,422800
+429004,仙桃市,4,429000
+429005,潜江市,4,429000
+429006,天门市,4,429000
+429021,神农架林区,4,429000
+430102,芙蓉区,4,430100
+430103,天心区,4,430100
+430104,岳麓区,4,430100
+430105,开福区,4,430100
+430111,雨花区,4,430100
+430112,望城区,4,430100
+430121,长沙县,4,430100
+430181,浏阳市,4,430100
+430182,宁乡市,4,430100
+430202,荷塘区,4,430200
+430203,芦淞区,4,430200
+430204,石峰区,4,430200
+430211,天元区,4,430200
+430212,渌口区,4,430200
+430223,攸县,4,430200
+430224,茶陵县,4,430200
+430225,炎陵县,4,430200
+430271,云龙示范区,4,430200
+430281,醴陵市,4,430200
+430302,雨湖区,4,430300
+430304,岳塘区,4,430300
+430321,湘潭县,4,430300
+430371,湖南湘潭高新技术产业园区,4,430300
+430372,湘潭昭山示范区,4,430300
+430373,湘潭九华示范区,4,430300
+430381,湘乡市,4,430300
+430382,韶山市,4,430300
+430405,珠晖区,4,430400
+430406,雁峰区,4,430400
+430407,石鼓区,4,430400
+430408,蒸湘区,4,430400
+430412,南岳区,4,430400
+430421,衡阳县,4,430400
+430422,衡南县,4,430400
+430423,衡山县,4,430400
+430424,衡东县,4,430400
+430426,祁东县,4,430400
+430471,衡阳综合保税区,4,430400
+430472,湖南衡阳高新技术产业园区,4,430400
+430473,湖南衡阳松木经济开发区,4,430400
+430481,耒阳市,4,430400
+430482,常宁市,4,430400
+430502,双清区,4,430500
+430503,大祥区,4,430500
+430511,北塔区,4,430500
+430522,新邵县,4,430500
+430523,邵阳县,4,430500
+430524,隆回县,4,430500
+430525,洞口县,4,430500
+430527,绥宁县,4,430500
+430528,新宁县,4,430500
+430529,城步苗族自治县,4,430500
+430581,武冈市,4,430500
+430582,邵东市,4,430500
+430602,岳阳楼区,4,430600
+430603,云溪区,4,430600
+430611,君山区,4,430600
+430621,岳阳县,4,430600
+430623,华容县,4,430600
+430624,湘阴县,4,430600
+430626,平江县,4,430600
+430671,岳阳市屈原管理区,4,430600
+430681,汨罗市,4,430600
+430682,临湘市,4,430600
+430702,武陵区,4,430700
+430703,鼎城区,4,430700
+430721,安乡县,4,430700
+430722,汉寿县,4,430700
+430723,澧县,4,430700
+430724,临澧县,4,430700
+430725,桃源县,4,430700
+430726,石门县,4,430700
+430771,常德市西洞庭管理区,4,430700
+430781,津市市,4,430700
+430802,永定区,4,430800
+430811,武陵源区,4,430800
+430821,慈利县,4,430800
+430822,桑植县,4,430800
+430902,资阳区,4,430900
+430903,赫山区,4,430900
+430921,南县,4,430900
+430922,桃江县,4,430900
+430923,安化县,4,430900
+430971,益阳市大通湖管理区,4,430900
+430972,湖南益阳高新技术产业园区,4,430900
+430981,沅江市,4,430900
+431002,北湖区,4,431000
+431003,苏仙区,4,431000
+431021,桂阳县,4,431000
+431022,宜章县,4,431000
+431023,永兴县,4,431000
+431024,嘉禾县,4,431000
+431025,临武县,4,431000
+431026,汝城县,4,431000
+431027,桂东县,4,431000
+431028,安仁县,4,431000
+431081,资兴市,4,431000
+431102,零陵区,4,431100
+431103,冷水滩区,4,431100
+431122,东安县,4,431100
+431123,双牌县,4,431100
+431124,道县,4,431100
+431125,江永县,4,431100
+431126,宁远县,4,431100
+431127,蓝山县,4,431100
+431128,新田县,4,431100
+431129,江华瑶族自治县,4,431100
+431171,永州经济技术开发区,4,431100
+431173,永州市回龙圩管理区,4,431100
+431181,祁阳市,4,431100
+431202,鹤城区,4,431200
+431221,中方县,4,431200
+431222,沅陵县,4,431200
+431223,辰溪县,4,431200
+431224,溆浦县,4,431200
+431225,会同县,4,431200
+431226,麻阳苗族自治县,4,431200
+431227,新晃侗族自治县,4,431200
+431228,芷江侗族自治县,4,431200
+431229,靖州苗族侗族自治县,4,431200
+431230,通道侗族自治县,4,431200
+431271,怀化市洪江管理区,4,431200
+431281,洪江市,4,431200
+431302,娄星区,4,431300
+431321,双峰县,4,431300
+431322,新化县,4,431300
+431381,冷水江市,4,431300
+431382,涟源市,4,431300
+433101,吉首市,4,433100
+433122,泸溪县,4,433100
+433123,凤凰县,4,433100
+433124,花垣县,4,433100
+433125,保靖县,4,433100
+433126,古丈县,4,433100
+433127,永顺县,4,433100
+433130,龙山县,4,433100
+440103,荔湾区,4,440100
+440104,越秀区,4,440100
+440105,海珠区,4,440100
+440106,天河区,4,440100
+440111,白云区,4,440100
+440112,黄埔区,4,440100
+440113,番禺区,4,440100
+440114,花都区,4,440100
+440115,南沙区,4,440100
+440117,从化区,4,440100
+440118,增城区,4,440100
+440203,武江区,4,440200
+440204,浈江区,4,440200
+440205,曲江区,4,440200
+440222,始兴县,4,440200
+440224,仁化县,4,440200
+440229,翁源县,4,440200
+440232,乳源瑶族自治县,4,440200
+440233,新丰县,4,440200
+440281,乐昌市,4,440200
+440282,南雄市,4,440200
+440303,罗湖区,4,440300
+440304,福田区,4,440300
+440305,南山区,4,440300
+440306,宝安区,4,440300
+440307,龙岗区,4,440300
+440308,盐田区,4,440300
+440309,龙华区,4,440300
+440310,坪山区,4,440300
+440311,光明区,4,440300
+440402,香洲区,4,440400
+440403,斗门区,4,440400
+440404,金湾区,4,440400
+440507,龙湖区,4,440500
+440511,金平区,4,440500
+440512,濠江区,4,440500
+440513,潮阳区,4,440500
+440514,潮南区,4,440500
+440515,澄海区,4,440500
+440523,南澳县,4,440500
+440604,禅城区,4,440600
+440605,南海区,4,440600
+440606,顺德区,4,440600
+440607,三水区,4,440600
+440608,高明区,4,440600
+440703,蓬江区,4,440700
+440704,江海区,4,440700
+440705,新会区,4,440700
+440781,台山市,4,440700
+440783,开平市,4,440700
+440784,鹤山市,4,440700
+440785,恩平市,4,440700
+440802,赤坎区,4,440800
+440803,霞山区,4,440800
+440804,坡头区,4,440800
+440811,麻章区,4,440800
+440823,遂溪县,4,440800
+440825,徐闻县,4,440800
+440881,廉江市,4,440800
+440882,雷州市,4,440800
+440883,吴川市,4,440800
+440902,茂南区,4,440900
+440904,电白区,4,440900
+440981,高州市,4,440900
+440982,化州市,4,440900
+440983,信宜市,4,440900
+441202,端州区,4,441200
+441203,鼎湖区,4,441200
+441204,高要区,4,441200
+441223,广宁县,4,441200
+441224,怀集县,4,441200
+441225,封开县,4,441200
+441226,德庆县,4,441200
+441284,四会市,4,441200
+441302,惠城区,4,441300
+441303,惠阳区,4,441300
+441322,博罗县,4,441300
+441323,惠东县,4,441300
+441324,龙门县,4,441300
+441402,梅江区,4,441400
+441403,梅县区,4,441400
+441422,大埔县,4,441400
+441423,丰顺县,4,441400
+441424,五华县,4,441400
+441426,平远县,4,441400
+441427,蕉岭县,4,441400
+441481,兴宁市,4,441400
+441502,城区,4,441500
+441521,海丰县,4,441500
+441523,陆河县,4,441500
+441581,陆丰市,4,441500
+441602,源城区,4,441600
+441621,紫金县,4,441600
+441622,龙川县,4,441600
+441623,连平县,4,441600
+441624,和平县,4,441600
+441625,东源县,4,441600
+441702,江城区,4,441700
+441704,阳东区,4,441700
+441721,阳西县,4,441700
+441781,阳春市,4,441700
+441802,清城区,4,441800
+441803,清新区,4,441800
+441821,佛冈县,4,441800
+441823,阳山县,4,441800
+441825,连山壮族瑶族自治县,4,441800
+441826,连南瑶族自治县,4,441800
+441881,英德市,4,441800
+441882,连州市,4,441800
+445102,湘桥区,4,445100
+445103,潮安区,4,445100
+445122,饶平县,4,445100
+445202,榕城区,4,445200
+445203,揭东区,4,445200
+445222,揭西县,4,445200
+445224,惠来县,4,445200
+445281,普宁市,4,445200
+445302,云城区,4,445300
+445303,云安区,4,445300
+445321,新兴县,4,445300
+445322,郁南县,4,445300
+445381,罗定市,4,445300
+450102,兴宁区,4,450100
+450103,青秀区,4,450100
+450105,江南区,4,450100
+450107,西乡塘区,4,450100
+450108,良庆区,4,450100
+450109,邕宁区,4,450100
+450110,武鸣区,4,450100
+450123,隆安县,4,450100
+450124,马山县,4,450100
+450125,上林县,4,450100
+450126,宾阳县,4,450100
+450181,横州市,4,450100
+450202,城中区,4,450200
+450203,鱼峰区,4,450200
+450204,柳南区,4,450200
+450205,柳北区,4,450200
+450206,柳江区,4,450200
+450222,柳城县,4,450200
+450223,鹿寨县,4,450200
+450224,融安县,4,450200
+450225,融水苗族自治县,4,450200
+450226,三江侗族自治县,4,450200
+450302,秀峰区,4,450300
+450303,叠彩区,4,450300
+450304,象山区,4,450300
+450305,七星区,4,450300
+450311,雁山区,4,450300
+450312,临桂区,4,450300
+450321,阳朔县,4,450300
+450323,灵川县,4,450300
+450324,全州县,4,450300
+450325,兴安县,4,450300
+450326,永福县,4,450300
+450327,灌阳县,4,450300
+450328,龙胜各族自治县,4,450300
+450329,资源县,4,450300
+450330,平乐县,4,450300
+450332,恭城瑶族自治县,4,450300
+450381,荔浦市,4,450300
+450403,万秀区,4,450400
+450405,长洲区,4,450400
+450406,龙圩区,4,450400
+450421,苍梧县,4,450400
+450422,藤县,4,450400
+450423,蒙山县,4,450400
+450481,岑溪市,4,450400
+450502,海城区,4,450500
+450503,银海区,4,450500
+450512,铁山港区,4,450500
+450521,合浦县,4,450500
+450602,港口区,4,450600
+450603,防城区,4,450600
+450621,上思县,4,450600
+450681,东兴市,4,450600
+450702,钦南区,4,450700
+450703,钦北区,4,450700
+450721,灵山县,4,450700
+450722,浦北县,4,450700
+450802,港北区,4,450800
+450803,港南区,4,450800
+450804,覃塘区,4,450800
+450821,平南县,4,450800
+450881,桂平市,4,450800
+450902,玉州区,4,450900
+450903,福绵区,4,450900
+450921,容县,4,450900
+450922,陆川县,4,450900
+450923,博白县,4,450900
+450924,兴业县,4,450900
+450981,北流市,4,450900
+451002,右江区,4,451000
+451003,田阳区,4,451000
+451022,田东县,4,451000
+451024,德保县,4,451000
+451026,那坡县,4,451000
+451027,凌云县,4,451000
+451028,乐业县,4,451000
+451029,田林县,4,451000
+451030,西林县,4,451000
+451031,隆林各族自治县,4,451000
+451081,靖西市,4,451000
+451082,平果市,4,451000
+451102,八步区,4,451100
+451103,平桂区,4,451100
+451121,昭平县,4,451100
+451122,钟山县,4,451100
+451123,富川瑶族自治县,4,451100
+451202,金城江区,4,451200
+451203,宜州区,4,451200
+451221,南丹县,4,451200
+451222,天峨县,4,451200
+451223,凤山县,4,451200
+451224,东兰县,4,451200
+451225,罗城仫佬族自治县,4,451200
+451226,环江毛南族自治县,4,451200
+451227,巴马瑶族自治县,4,451200
+451228,都安瑶族自治县,4,451200
+451229,大化瑶族自治县,4,451200
+451302,兴宾区,4,451300
+451321,忻城县,4,451300
+451322,象州县,4,451300
+451323,武宣县,4,451300
+451324,金秀瑶族自治县,4,451300
+451381,合山市,4,451300
+451402,江州区,4,451400
+451421,扶绥县,4,451400
+451422,宁明县,4,451400
+451423,龙州县,4,451400
+451424,大新县,4,451400
+451425,天等县,4,451400
+451481,凭祥市,4,451400
+460105,秀英区,4,460100
+460106,龙华区,4,460100
+460107,琼山区,4,460100
+460108,美兰区,4,460100
+460202,海棠区,4,460200
+460203,吉阳区,4,460200
+460204,天涯区,4,460200
+460205,崖州区,4,460200
+460321,西沙群岛,4,460300
+460322,南沙群岛,4,460300
+460323,中沙群岛的岛礁及其海域,4,460300
+469001,五指山市,4,469000
+469002,琼海市,4,469000
+469005,文昌市,4,469000
+469006,万宁市,4,469000
+469007,东方市,4,469000
+469021,定安县,4,469000
+469022,屯昌县,4,469000
+469023,澄迈县,4,469000
+469024,临高县,4,469000
+469025,白沙黎族自治县,4,469000
+469026,昌江黎族自治县,4,469000
+469027,乐东黎族自治县,4,469000
+469028,陵水黎族自治县,4,469000
+469029,保亭黎族苗族自治县,4,469000
+469030,琼中黎族苗族自治县,4,469000
+500101,万州区,4,500100
+500102,涪陵区,4,500100
+500103,渝中区,4,500100
+500104,大渡口区,4,500100
+500105,江北区,4,500100
+500106,沙坪坝区,4,500100
+500107,九龙坡区,4,500100
+500108,南岸区,4,500100
+500109,北碚区,4,500100
+500110,綦江区,4,500100
+500111,大足区,4,500100
+500112,渝北区,4,500100
+500113,巴南区,4,500100
+500114,黔江区,4,500100
+500115,长寿区,4,500100
+500116,江津区,4,500100
+500117,合川区,4,500100
+500118,永川区,4,500100
+500119,南川区,4,500100
+500120,璧山区,4,500100
+500151,铜梁区,4,500100
+500152,潼南区,4,500100
+500153,荣昌区,4,500100
+500154,开州区,4,500100
+500155,梁平区,4,500100
+500156,武隆区,4,500100
+500229,城口县,4,500100
+500230,丰都县,4,500100
+500231,垫江县,4,500100
+500233,忠县,4,500100
+500235,云阳县,4,500100
+500236,奉节县,4,500100
+500237,巫山县,4,500100
+500238,巫溪县,4,500100
+500240,石柱土家族自治县,4,500100
+500241,秀山土家族苗族自治县,4,500100
+500242,酉阳土家族苗族自治县,4,500100
+500243,彭水苗族土家族自治县,4,500100
+510104,锦江区,4,510100
+510105,青羊区,4,510100
+510106,金牛区,4,510100
+510107,武侯区,4,510100
+510108,成华区,4,510100
+510112,龙泉驿区,4,510100
+510113,青白江区,4,510100
+510114,新都区,4,510100
+510115,温江区,4,510100
+510116,双流区,4,510100
+510117,郫都区,4,510100
+510118,新津区,4,510100
+510121,金堂县,4,510100
+510129,大邑县,4,510100
+510131,蒲江县,4,510100
+510181,都江堰市,4,510100
+510182,彭州市,4,510100
+510183,邛崃市,4,510100
+510184,崇州市,4,510100
+510185,简阳市,4,510100
+510302,自流井区,4,510300
+510303,贡井区,4,510300
+510304,大安区,4,510300
+510311,沿滩区,4,510300
+510321,荣县,4,510300
+510322,富顺县,4,510300
+510402,东区,4,510400
+510403,西区,4,510400
+510411,仁和区,4,510400
+510421,米易县,4,510400
+510422,盐边县,4,510400
+510502,江阳区,4,510500
+510503,纳溪区,4,510500
+510504,龙马潭区,4,510500
+510521,泸县,4,510500
+510522,合江县,4,510500
+510524,叙永县,4,510500
+510525,古蔺县,4,510500
+510603,旌阳区,4,510600
+510604,罗江区,4,510600
+510623,中江县,4,510600
+510681,广汉市,4,510600
+510682,什邡市,4,510600
+510683,绵竹市,4,510600
+510703,涪城区,4,510700
+510704,游仙区,4,510700
+510705,安州区,4,510700
+510722,三台县,4,510700
+510723,盐亭县,4,510700
+510725,梓潼县,4,510700
+510726,北川羌族自治县,4,510700
+510727,平武县,4,510700
+510781,江油市,4,510700
+510802,利州区,4,510800
+510811,昭化区,4,510800
+510812,朝天区,4,510800
+510821,旺苍县,4,510800
+510822,青川县,4,510800
+510823,剑阁县,4,510800
+510824,苍溪县,4,510800
+510903,船山区,4,510900
+510904,安居区,4,510900
+510921,蓬溪县,4,510900
+510923,大英县,4,510900
+510981,射洪市,4,510900
+511002,市中区,4,511000
+511011,东兴区,4,511000
+511024,威远县,4,511000
+511025,资中县,4,511000
+511071,内江经济开发区,4,511000
+511083,隆昌市,4,511000
+511102,市中区,4,511100
+511111,沙湾区,4,511100
+511112,五通桥区,4,511100
+511113,金口河区,4,511100
+511123,犍为县,4,511100
+511124,井研县,4,511100
+511126,夹江县,4,511100
+511129,沐川县,4,511100
+511132,峨边彝族自治县,4,511100
+511133,马边彝族自治县,4,511100
+511181,峨眉山市,4,511100
+511302,顺庆区,4,511300
+511303,高坪区,4,511300
+511304,嘉陵区,4,511300
+511321,南部县,4,511300
+511322,营山县,4,511300
+511323,蓬安县,4,511300
+511324,仪陇县,4,511300
+511325,西充县,4,511300
+511381,阆中市,4,511300
+511402,东坡区,4,511400
+511403,彭山区,4,511400
+511421,仁寿县,4,511400
+511423,洪雅县,4,511400
+511424,丹棱县,4,511400
+511425,青神县,4,511400
+511502,翠屏区,4,511500
+511503,南溪区,4,511500
+511504,叙州区,4,511500
+511523,江安县,4,511500
+511524,长宁县,4,511500
+511525,高县,4,511500
+511526,珙县,4,511500
+511527,筠连县,4,511500
+511528,兴文县,4,511500
+511529,屏山县,4,511500
+511602,广安区,4,511600
+511603,前锋区,4,511600
+511621,岳池县,4,511600
+511622,武胜县,4,511600
+511623,邻水县,4,511600
+511681,华蓥市,4,511600
+511702,通川区,4,511700
+511703,达川区,4,511700
+511722,宣汉县,4,511700
+511723,开江县,4,511700
+511724,大竹县,4,511700
+511725,渠县,4,511700
+511771,达州经济开发区,4,511700
+511781,万源市,4,511700
+511802,雨城区,4,511800
+511803,名山区,4,511800
+511822,荥经县,4,511800
+511823,汉源县,4,511800
+511824,石棉县,4,511800
+511825,天全县,4,511800
+511826,芦山县,4,511800
+511827,宝兴县,4,511800
+511902,巴州区,4,511900
+511903,恩阳区,4,511900
+511921,通江县,4,511900
+511922,南江县,4,511900
+511923,平昌县,4,511900
+511971,巴中经济开发区,4,511900
+512002,雁江区,4,512000
+512021,安岳县,4,512000
+512022,乐至县,4,512000
+513201,马尔康市,4,513200
+513221,汶川县,4,513200
+513222,理县,4,513200
+513223,茂县,4,513200
+513224,松潘县,4,513200
+513225,九寨沟县,4,513200
+513226,金川县,4,513200
+513227,小金县,4,513200
+513228,黑水县,4,513200
+513230,壤塘县,4,513200
+513231,阿坝县,4,513200
+513232,若尔盖县,4,513200
+513233,红原县,4,513200
+513301,康定市,4,513300
+513322,泸定县,4,513300
+513323,丹巴县,4,513300
+513324,九龙县,4,513300
+513325,雅江县,4,513300
+513326,道孚县,4,513300
+513327,炉霍县,4,513300
+513328,甘孜县,4,513300
+513329,新龙县,4,513300
+513330,德格县,4,513300
+513331,白玉县,4,513300
+513332,石渠县,4,513300
+513333,色达县,4,513300
+513334,理塘县,4,513300
+513335,巴塘县,4,513300
+513336,乡城县,4,513300
+513337,稻城县,4,513300
+513338,得荣县,4,513300
+513401,西昌市,4,513400
+513402,会理市,4,513400
+513422,木里藏族自治县,4,513400
+513423,盐源县,4,513400
+513424,德昌县,4,513400
+513426,会东县,4,513400
+513427,宁南县,4,513400
+513428,普格县,4,513400
+513429,布拖县,4,513400
+513430,金阳县,4,513400
+513431,昭觉县,4,513400
+513432,喜德县,4,513400
+513433,冕宁县,4,513400
+513434,越西县,4,513400
+513435,甘洛县,4,513400
+513436,美姑县,4,513400
+513437,雷波县,4,513400
+520102,南明区,4,520100
+520103,云岩区,4,520100
+520111,花溪区,4,520100
+520112,乌当区,4,520100
+520113,白云区,4,520100
+520115,观山湖区,4,520100
+520121,开阳县,4,520100
+520122,息烽县,4,520100
+520123,修文县,4,520100
+520181,清镇市,4,520100
+520201,钟山区,4,520200
+520203,六枝特区,4,520200
+520204,水城区,4,520200
+520281,盘州市,4,520200
+520302,红花岗区,4,520300
+520303,汇川区,4,520300
+520304,播州区,4,520300
+520322,桐梓县,4,520300
+520323,绥阳县,4,520300
+520324,正安县,4,520300
+520325,道真仡佬族苗族自治县,4,520300
+520326,务川仡佬族苗族自治县,4,520300
+520327,凤冈县,4,520300
+520328,湄潭县,4,520300
+520329,余庆县,4,520300
+520330,习水县,4,520300
+520381,赤水市,4,520300
+520382,仁怀市,4,520300
+520402,西秀区,4,520400
+520403,平坝区,4,520400
+520422,普定县,4,520400
+520423,镇宁布依族苗族自治县,4,520400
+520424,关岭布依族苗族自治县,4,520400
+520425,紫云苗族布依族自治县,4,520400
+520502,七星关区,4,520500
+520521,大方县,4,520500
+520523,金沙县,4,520500
+520524,织金县,4,520500
+520525,纳雍县,4,520500
+520526,威宁彝族回族苗族自治县,4,520500
+520527,赫章县,4,520500
+520581,黔西市,4,520500
+520602,碧江区,4,520600
+520603,万山区,4,520600
+520621,江口县,4,520600
+520622,玉屏侗族自治县,4,520600
+520623,石阡县,4,520600
+520624,思南县,4,520600
+520625,印江土家族苗族自治县,4,520600
+520626,德江县,4,520600
+520627,沿河土家族自治县,4,520600
+520628,松桃苗族自治县,4,520600
+522301,兴义市,4,522300
+522302,兴仁市,4,522300
+522323,普安县,4,522300
+522324,晴隆县,4,522300
+522325,贞丰县,4,522300
+522326,望谟县,4,522300
+522327,册亨县,4,522300
+522328,安龙县,4,522300
+522601,凯里市,4,522600
+522622,黄平县,4,522600
+522623,施秉县,4,522600
+522624,三穗县,4,522600
+522625,镇远县,4,522600
+522626,岑巩县,4,522600
+522627,天柱县,4,522600
+522628,锦屏县,4,522600
+522629,剑河县,4,522600
+522630,台江县,4,522600
+522631,黎平县,4,522600
+522632,榕江县,4,522600
+522633,从江县,4,522600
+522634,雷山县,4,522600
+522635,麻江县,4,522600
+522636,丹寨县,4,522600
+522701,都匀市,4,522700
+522702,福泉市,4,522700
+522722,荔波县,4,522700
+522723,贵定县,4,522700
+522725,瓮安县,4,522700
+522726,独山县,4,522700
+522727,平塘县,4,522700
+522728,罗甸县,4,522700
+522729,长顺县,4,522700
+522730,龙里县,4,522700
+522731,惠水县,4,522700
+522732,三都水族自治县,4,522700
+530102,五华区,4,530100
+530103,盘龙区,4,530100
+530111,官渡区,4,530100
+530112,西山区,4,530100
+530113,东川区,4,530100
+530114,呈贡区,4,530100
+530115,晋宁区,4,530100
+530124,富民县,4,530100
+530125,宜良县,4,530100
+530126,石林彝族自治县,4,530100
+530127,嵩明县,4,530100
+530128,禄劝彝族苗族自治县,4,530100
+530129,寻甸回族彝族自治县,4,530100
+530181,安宁市,4,530100
+530302,麒麟区,4,530300
+530303,沾益区,4,530300
+530304,马龙区,4,530300
+530322,陆良县,4,530300
+530323,师宗县,4,530300
+530324,罗平县,4,530300
+530325,富源县,4,530300
+530326,会泽县,4,530300
+530381,宣威市,4,530300
+530402,红塔区,4,530400
+530403,江川区,4,530400
+530423,通海县,4,530400
+530424,华宁县,4,530400
+530425,易门县,4,530400
+530426,峨山彝族自治县,4,530400
+530427,新平彝族傣族自治县,4,530400
+530428,元江哈尼族彝族傣族自治县,4,530400
+530481,澄江市,4,530400
+530502,隆阳区,4,530500
+530521,施甸县,4,530500
+530523,龙陵县,4,530500
+530524,昌宁县,4,530500
+530581,腾冲市,4,530500
+530602,昭阳区,4,530600
+530621,鲁甸县,4,530600
+530622,巧家县,4,530600
+530623,盐津县,4,530600
+530624,大关县,4,530600
+530625,永善县,4,530600
+530626,绥江县,4,530600
+530627,镇雄县,4,530600
+530628,彝良县,4,530600
+530629,威信县,4,530600
+530681,水富市,4,530600
+530702,古城区,4,530700
+530721,玉龙纳西族自治县,4,530700
+530722,永胜县,4,530700
+530723,华坪县,4,530700
+530724,宁蒗彝族自治县,4,530700
+530802,思茅区,4,530800
+530821,宁洱哈尼族彝族自治县,4,530800
+530822,墨江哈尼族自治县,4,530800
+530823,景东彝族自治县,4,530800
+530824,景谷傣族彝族自治县,4,530800
+530825,镇沅彝族哈尼族拉祜族自治县,4,530800
+530826,江城哈尼族彝族自治县,4,530800
+530827,孟连傣族拉祜族佤族自治县,4,530800
+530828,澜沧拉祜族自治县,4,530800
+530829,西盟佤族自治县,4,530800
+530902,临翔区,4,530900
+530921,凤庆县,4,530900
+530922,云县,4,530900
+530923,永德县,4,530900
+530924,镇康县,4,530900
+530925,双江拉祜族佤族布朗族傣族自治县,4,530900
+530926,耿马傣族佤族自治县,4,530900
+530927,沧源佤族自治县,4,530900
+532301,楚雄市,4,532300
+532302,禄丰市,4,532300
+532322,双柏县,4,532300
+532323,牟定县,4,532300
+532324,南华县,4,532300
+532325,姚安县,4,532300
+532326,大姚县,4,532300
+532327,永仁县,4,532300
+532328,元谋县,4,532300
+532329,武定县,4,532300
+532501,个旧市,4,532500
+532502,开远市,4,532500
+532503,蒙自市,4,532500
+532504,弥勒市,4,532500
+532523,屏边苗族自治县,4,532500
+532524,建水县,4,532500
+532525,石屏县,4,532500
+532527,泸西县,4,532500
+532528,元阳县,4,532500
+532529,红河县,4,532500
+532530,金平苗族瑶族傣族自治县,4,532500
+532531,绿春县,4,532500
+532532,河口瑶族自治县,4,532500
+532601,文山市,4,532600
+532622,砚山县,4,532600
+532623,西畴县,4,532600
+532624,麻栗坡县,4,532600
+532625,马关县,4,532600
+532626,丘北县,4,532600
+532627,广南县,4,532600
+532628,富宁县,4,532600
+532801,景洪市,4,532800
+532822,勐海县,4,532800
+532823,勐腊县,4,532800
+532901,大理市,4,532900
+532922,漾濞彝族自治县,4,532900
+532923,祥云县,4,532900
+532924,宾川县,4,532900
+532925,弥渡县,4,532900
+532926,南涧彝族自治县,4,532900
+532927,巍山彝族回族自治县,4,532900
+532928,永平县,4,532900
+532929,云龙县,4,532900
+532930,洱源县,4,532900
+532931,剑川县,4,532900
+532932,鹤庆县,4,532900
+533102,瑞丽市,4,533100
+533103,芒市,4,533100
+533122,梁河县,4,533100
+533123,盈江县,4,533100
+533124,陇川县,4,533100
+533301,泸水市,4,533300
+533323,福贡县,4,533300
+533324,贡山独龙族怒族自治县,4,533300
+533325,兰坪白族普米族自治县,4,533300
+533401,香格里拉市,4,533400
+533422,德钦县,4,533400
+533423,维西傈僳族自治县,4,533400
+540102,城关区,4,540100
+540103,堆龙德庆区,4,540100
+540104,达孜区,4,540100
+540121,林周县,4,540100
+540122,当雄县,4,540100
+540123,尼木县,4,540100
+540124,曲水县,4,540100
+540127,墨竹工卡县,4,540100
+540171,格尔木藏青工业园区,4,540100
+540172,拉萨经济技术开发区,4,540100
+540173,西藏文化旅游创意园区,4,540100
+540174,达孜工业园区,4,540100
+540202,桑珠孜区,4,540200
+540221,南木林县,4,540200
+540222,江孜县,4,540200
+540223,定日县,4,540200
+540224,萨迦县,4,540200
+540225,拉孜县,4,540200
+540226,昂仁县,4,540200
+540227,谢通门县,4,540200
+540228,白朗县,4,540200
+540229,仁布县,4,540200
+540230,康马县,4,540200
+540231,定结县,4,540200
+540232,仲巴县,4,540200
+540233,亚东县,4,540200
+540234,吉隆县,4,540200
+540235,聂拉木县,4,540200
+540236,萨嘎县,4,540200
+540237,岗巴县,4,540200
+540302,卡若区,4,540300
+540321,江达县,4,540300
+540322,贡觉县,4,540300
+540323,类乌齐县,4,540300
+540324,丁青县,4,540300
+540325,察雅县,4,540300
+540326,八宿县,4,540300
+540327,左贡县,4,540300
+540328,芒康县,4,540300
+540329,洛隆县,4,540300
+540330,边坝县,4,540300
+540402,巴宜区,4,540400
+540421,工布江达县,4,540400
+540422,米林县,4,540400
+540423,墨脱县,4,540400
+540424,波密县,4,540400
+540425,察隅县,4,540400
+540426,朗县,4,540400
+540502,乃东区,4,540500
+540521,扎囊县,4,540500
+540522,贡嘎县,4,540500
+540523,桑日县,4,540500
+540524,琼结县,4,540500
+540525,曲松县,4,540500
+540526,措美县,4,540500
+540527,洛扎县,4,540500
+540528,加查县,4,540500
+540529,隆子县,4,540500
+540530,错那县,4,540500
+540531,浪卡子县,4,540500
+540602,色尼区,4,540600
+540621,嘉黎县,4,540600
+540622,比如县,4,540600
+540623,聂荣县,4,540600
+540624,安多县,4,540600
+540625,申扎县,4,540600
+540626,索县,4,540600
+540627,班戈县,4,540600
+540628,巴青县,4,540600
+540629,尼玛县,4,540600
+540630,双湖县,4,540600
+542521,普兰县,4,542500
+542522,札达县,4,542500
+542523,噶尔县,4,542500
+542524,日土县,4,542500
+542525,革吉县,4,542500
+542526,改则县,4,542500
+542527,措勤县,4,542500
+610102,新城区,4,610100
+610103,碑林区,4,610100
+610104,莲湖区,4,610100
+610111,灞桥区,4,610100
+610112,未央区,4,610100
+610113,雁塔区,4,610100
+610114,阎良区,4,610100
+610115,临潼区,4,610100
+610116,长安区,4,610100
+610117,高陵区,4,610100
+610118,鄠邑区,4,610100
+610122,蓝田县,4,610100
+610124,周至县,4,610100
+610202,王益区,4,610200
+610203,印台区,4,610200
+610204,耀州区,4,610200
+610222,宜君县,4,610200
+610302,渭滨区,4,610300
+610303,金台区,4,610300
+610304,陈仓区,4,610300
+610305,凤翔区,4,610300
+610323,岐山县,4,610300
+610324,扶风县,4,610300
+610326,眉县,4,610300
+610327,陇县,4,610300
+610328,千阳县,4,610300
+610329,麟游县,4,610300
+610330,凤县,4,610300
+610331,太白县,4,610300
+610402,秦都区,4,610400
+610403,杨陵区,4,610400
+610404,渭城区,4,610400
+610422,三原县,4,610400
+610423,泾阳县,4,610400
+610424,乾县,4,610400
+610425,礼泉县,4,610400
+610426,永寿县,4,610400
+610428,长武县,4,610400
+610429,旬邑县,4,610400
+610430,淳化县,4,610400
+610431,武功县,4,610400
+610481,兴平市,4,610400
+610482,彬州市,4,610400
+610502,临渭区,4,610500
+610503,华州区,4,610500
+610522,潼关县,4,610500
+610523,大荔县,4,610500
+610524,合阳县,4,610500
+610525,澄城县,4,610500
+610526,蒲城县,4,610500
+610527,白水县,4,610500
+610528,富平县,4,610500
+610581,韩城市,4,610500
+610582,华阴市,4,610500
+610602,宝塔区,4,610600
+610603,安塞区,4,610600
+610621,延长县,4,610600
+610622,延川县,4,610600
+610625,志丹县,4,610600
+610626,吴起县,4,610600
+610627,甘泉县,4,610600
+610628,富县,4,610600
+610629,洛川县,4,610600
+610630,宜川县,4,610600
+610631,黄龙县,4,610600
+610632,黄陵县,4,610600
+610681,子长市,4,610600
+610702,汉台区,4,610700
+610703,南郑区,4,610700
+610722,城固县,4,610700
+610723,洋县,4,610700
+610724,西乡县,4,610700
+610725,勉县,4,610700
+610726,宁强县,4,610700
+610727,略阳县,4,610700
+610728,镇巴县,4,610700
+610729,留坝县,4,610700
+610730,佛坪县,4,610700
+610802,榆阳区,4,610800
+610803,横山区,4,610800
+610822,府谷县,4,610800
+610824,靖边县,4,610800
+610825,定边县,4,610800
+610826,绥德县,4,610800
+610827,米脂县,4,610800
+610828,佳县,4,610800
+610829,吴堡县,4,610800
+610830,清涧县,4,610800
+610831,子洲县,4,610800
+610881,神木市,4,610800
+610902,汉滨区,4,610900
+610921,汉阴县,4,610900
+610922,石泉县,4,610900
+610923,宁陕县,4,610900
+610924,紫阳县,4,610900
+610925,岚皋县,4,610900
+610926,平利县,4,610900
+610927,镇坪县,4,610900
+610929,白河县,4,610900
+610981,旬阳市,4,610900
+611002,商州区,4,611000
+611021,洛南县,4,611000
+611022,丹凤县,4,611000
+611023,商南县,4,611000
+611024,山阳县,4,611000
+611025,镇安县,4,611000
+611026,柞水县,4,611000
+620102,城关区,4,620100
+620103,七里河区,4,620100
+620104,西固区,4,620100
+620105,安宁区,4,620100
+620111,红古区,4,620100
+620121,永登县,4,620100
+620122,皋兰县,4,620100
+620123,榆中县,4,620100
+620171,兰州新区,4,620100
+620201,嘉峪关市,4,620200
+620302,金川区,4,620300
+620321,永昌县,4,620300
+620402,白银区,4,620400
+620403,平川区,4,620400
+620421,靖远县,4,620400
+620422,会宁县,4,620400
+620423,景泰县,4,620400
+620502,秦州区,4,620500
+620503,麦积区,4,620500
+620521,清水县,4,620500
+620522,秦安县,4,620500
+620523,甘谷县,4,620500
+620524,武山县,4,620500
+620525,张家川回族自治县,4,620500
+620602,凉州区,4,620600
+620621,民勤县,4,620600
+620622,古浪县,4,620600
+620623,天祝藏族自治县,4,620600
+620702,甘州区,4,620700
+620721,肃南裕固族自治县,4,620700
+620722,民乐县,4,620700
+620723,临泽县,4,620700
+620724,高台县,4,620700
+620725,山丹县,4,620700
+620802,崆峒区,4,620800
+620821,泾川县,4,620800
+620822,灵台县,4,620800
+620823,崇信县,4,620800
+620825,庄浪县,4,620800
+620826,静宁县,4,620800
+620881,华亭市,4,620800
+620902,肃州区,4,620900
+620921,金塔县,4,620900
+620922,瓜州县,4,620900
+620923,肃北蒙古族自治县,4,620900
+620924,阿克塞哈萨克族自治县,4,620900
+620981,玉门市,4,620900
+620982,敦煌市,4,620900
+621002,西峰区,4,621000
+621021,庆城县,4,621000
+621022,环县,4,621000
+621023,华池县,4,621000
+621024,合水县,4,621000
+621025,正宁县,4,621000
+621026,宁县,4,621000
+621027,镇原县,4,621000
+621102,安定区,4,621100
+621121,通渭县,4,621100
+621122,陇西县,4,621100
+621123,渭源县,4,621100
+621124,临洮县,4,621100
+621125,漳县,4,621100
+621126,岷县,4,621100
+621202,武都区,4,621200
+621221,成县,4,621200
+621222,文县,4,621200
+621223,宕昌县,4,621200
+621224,康县,4,621200
+621225,西和县,4,621200
+621226,礼县,4,621200
+621227,徽县,4,621200
+621228,两当县,4,621200
+622901,临夏市,4,622900
+622921,临夏县,4,622900
+622922,康乐县,4,622900
+622923,永靖县,4,622900
+622924,广河县,4,622900
+622925,和政县,4,622900
+622926,东乡族自治县,4,622900
+622927,积石山保安族东乡族撒拉族自治县,4,622900
+623001,合作市,4,623000
+623021,临潭县,4,623000
+623022,卓尼县,4,623000
+623023,舟曲县,4,623000
+623024,迭部县,4,623000
+623025,玛曲县,4,623000
+623026,碌曲县,4,623000
+623027,夏河县,4,623000
+630102,城东区,4,630100
+630103,城中区,4,630100
+630104,城西区,4,630100
+630105,城北区,4,630100
+630106,湟中区,4,630100
+630121,大通回族土族自治县,4,630100
+630123,湟源县,4,630100
+630202,乐都区,4,630200
+630203,平安区,4,630200
+630222,民和回族土族自治县,4,630200
+630223,互助土族自治县,4,630200
+630224,化隆回族自治县,4,630200
+630225,循化撒拉族自治县,4,630200
+632221,门源回族自治县,4,632200
+632222,祁连县,4,632200
+632223,海晏县,4,632200
+632224,刚察县,4,632200
+632301,同仁市,4,632300
+632322,尖扎县,4,632300
+632323,泽库县,4,632300
+632324,河南蒙古族自治县,4,632300
+632521,共和县,4,632500
+632522,同德县,4,632500
+632523,贵德县,4,632500
+632524,兴海县,4,632500
+632525,贵南县,4,632500
+632621,玛沁县,4,632600
+632622,班玛县,4,632600
+632623,甘德县,4,632600
+632624,达日县,4,632600
+632625,久治县,4,632600
+632626,玛多县,4,632600
+632701,玉树市,4,632700
+632722,杂多县,4,632700
+632723,称多县,4,632700
+632724,治多县,4,632700
+632725,囊谦县,4,632700
+632726,曲麻莱县,4,632700
+632801,格尔木市,4,632800
+632802,德令哈市,4,632800
+632803,茫崖市,4,632800
+632821,乌兰县,4,632800
+632822,都兰县,4,632800
+632823,天峻县,4,632800
+632857,大柴旦行政委员会,4,632800
+640104,兴庆区,4,640100
+640105,西夏区,4,640100
+640106,金凤区,4,640100
+640121,永宁县,4,640100
+640122,贺兰县,4,640100
+640181,灵武市,4,640100
+640202,大武口区,4,640200
+640205,惠农区,4,640200
+640221,平罗县,4,640200
+640302,利通区,4,640300
+640303,红寺堡区,4,640300
+640323,盐池县,4,640300
+640324,同心县,4,640300
+640381,青铜峡市,4,640300
+640402,原州区,4,640400
+640422,西吉县,4,640400
+640423,隆德县,4,640400
+640424,泾源县,4,640400
+640425,彭阳县,4,640400
+640502,沙坡头区,4,640500
+640521,中宁县,4,640500
+640522,海原县,4,640500
+650102,天山区,4,650100
+650103,沙依巴克区,4,650100
+650104,新市区,4,650100
+650105,水磨沟区,4,650100
+650106,头屯河区,4,650100
+650107,达坂城区,4,650100
+650109,米东区,4,650100
+650121,乌鲁木齐县,4,650100
+650202,独山子区,4,650200
+650203,克拉玛依区,4,650200
+650204,白碱滩区,4,650200
+650205,乌尔禾区,4,650200
+650402,高昌区,4,650400
+650421,鄯善县,4,650400
+650422,托克逊县,4,650400
+650502,伊州区,4,650500
+650521,巴里坤哈萨克自治县,4,650500
+650522,伊吾县,4,650500
+652301,昌吉市,4,652300
+652302,阜康市,4,652300
+652323,呼图壁县,4,652300
+652324,玛纳斯县,4,652300
+652325,奇台县,4,652300
+652327,吉木萨尔县,4,652300
+652328,木垒哈萨克自治县,4,652300
+652701,博乐市,4,652700
+652702,阿拉山口市,4,652700
+652722,精河县,4,652700
+652723,温泉县,4,652700
+652801,库尔勒市,4,652800
+652822,轮台县,4,652800
+652823,尉犁县,4,652800
+652824,若羌县,4,652800
+652825,且末县,4,652800
+652826,焉耆回族自治县,4,652800
+652827,和静县,4,652800
+652828,和硕县,4,652800
+652829,博湖县,4,652800
+652871,库尔勒经济技术开发区,4,652800
+652901,阿克苏市,4,652900
+652902,库车市,4,652900
+652922,温宿县,4,652900
+652924,沙雅县,4,652900
+652925,新和县,4,652900
+652926,拜城县,4,652900
+652927,乌什县,4,652900
+652928,阿瓦提县,4,652900
+652929,柯坪县,4,652900
+653001,阿图什市,4,653000
+653022,阿克陶县,4,653000
+653023,阿合奇县,4,653000
+653024,乌恰县,4,653000
+653101,喀什市,4,653100
+653121,疏附县,4,653100
+653122,疏勒县,4,653100
+653123,英吉沙县,4,653100
+653124,泽普县,4,653100
+653125,莎车县,4,653100
+653126,叶城县,4,653100
+653127,麦盖提县,4,653100
+653128,岳普湖县,4,653100
+653129,伽师县,4,653100
+653130,巴楚县,4,653100
+653131,塔什库尔干塔吉克自治县,4,653100
+653201,和田市,4,653200
+653221,和田县,4,653200
+653222,墨玉县,4,653200
+653223,皮山县,4,653200
+653224,洛浦县,4,653200
+653225,策勒县,4,653200
+653226,于田县,4,653200
+653227,民丰县,4,653200
+654002,伊宁市,4,654000
+654003,奎屯市,4,654000
+654004,霍尔果斯市,4,654000
+654021,伊宁县,4,654000
+654022,察布查尔锡伯自治县,4,654000
+654023,霍城县,4,654000
+654024,巩留县,4,654000
+654025,新源县,4,654000
+654026,昭苏县,4,654000
+654027,特克斯县,4,654000
+654028,尼勒克县,4,654000
+654201,塔城市,4,654200
+654202,乌苏市,4,654200
+654203,沙湾市,4,654200
+654221,额敏县,4,654200
+654224,托里县,4,654200
+654225,裕民县,4,654200
+654226,和布克赛尔蒙古自治县,4,654200
+654301,阿勒泰市,4,654300
+654321,布尔津县,4,654300
+654322,富蕴县,4,654300
+654323,福海县,4,654300
+654324,哈巴河县,4,654300
+654325,青河县,4,654300
+654326,吉木乃县,4,654300
+659001,石河子市,4,659000
+659002,阿拉尔市,4,659000
+659003,图木舒克市,4,659000
+659004,五家渠市,4,659000
+659005,北屯市,4,659000
+659006,铁门关市,4,659000
+659007,双河市,4,659000
+659008,可克达拉市,4,659000
+659009,昆玉市,4,659000
+659010,胡杨河市,4,659000
+659011,新星市,4,659000

BIN
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/resources/ip2region.xdb


+ 36 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtilsTest.java

@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.framework.ip.core.utils;
+
+
+import cn.iocoder.yudao.framework.ip.core.Area;
+import cn.iocoder.yudao.framework.ip.core.enums.AreaTypeEnum;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * {@link AreaUtils} 的单元测试
+ *
+ * @author 芋道源码
+ */
+public class AreaUtilsTest {
+
+    @Test
+    public void testGetArea() {
+        // 调用:北京
+        Area area = AreaUtils.getArea(110100);
+        // 断言
+        assertEquals(area.getId(), 110100);
+        assertEquals(area.getName(), "北京市");
+        assertEquals(area.getType(), AreaTypeEnum.CITY.getType());
+        assertEquals(area.getParent().getId(), 110000);
+        assertEquals(area.getChildren().size(), 16);
+    }
+
+    @Test
+    public void testFormat() {
+        assertEquals(AreaUtils.format(110105), "北京 北京市 朝阳区");
+        assertEquals(AreaUtils.format(1), "中国");
+        assertEquals(AreaUtils.format(2), "蒙古");
+    }
+
+}

+ 47 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/test/java/cn/iocoder/yudao/framework/ip/core/utils/IPUtilsTest.java

@@ -0,0 +1,47 @@
+package cn.iocoder.yudao.framework.ip.core.utils;
+
+import cn.iocoder.yudao.framework.ip.core.Area;
+import org.junit.jupiter.api.Test;
+import org.lionsoul.ip2region.xdb.Searcher;
+
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * {@link IPUtils} 的单元测试
+ *
+ * @author wanglhup
+ */
+public class IPUtilsTest {
+
+    @Test
+    public void testGetAreaId_string() {
+        // 120.202.4.0|120.202.4.255|420600
+        Integer areaId = IPUtils.getAreaId("120.202.4.50");
+        assertEquals(420600, areaId);
+    }
+
+    @Test
+    public void testGetAreaId_long() throws Exception {
+        // 120.203.123.0|120.203.133.255|360900
+        long ip = Searcher.checkIP("120.203.123.250");
+        Integer areaId = IPUtils.getAreaId(ip);
+        assertEquals(360900, areaId);
+    }
+
+    @Test
+    public void testGetArea_string() {
+        // 120.202.4.0|120.202.4.255|420600
+        Area area = IPUtils.getArea("120.202.4.50");
+        assertEquals("襄阳市", area.getName());
+    }
+
+    @Test
+    public void testGetArea_long() throws Exception {
+        // 120.203.123.0|120.203.133.255|360900
+        long ip = Searcher.checkIP("120.203.123.252");
+        Area area = IPUtils.getArea(ip);
+        assertEquals("宜春市", area.getName());
+    }
+
+}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно