Compare commits
78 Commits
master
...
master-jdk
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e7a62e7f0 | |||
| f252c69dd2 | |||
| 1eb543d803 | |||
| cff7832d5e | |||
| 6063256883 | |||
| 76bdb3a931 | |||
| 0984924431 | |||
| 011b505a80 | |||
| f620d3bb0c | |||
| 751e1be667 | |||
| 0d46e00ba7 | |||
| 877e691792 | |||
| f6b0410fda | |||
| dc65ef8d24 | |||
| bbcf68bdb8 | |||
| f7f318bed8 | |||
| 5f9bcfc9b2 | |||
| 8077990e5d | |||
|
|
bf6875adf6 | ||
|
|
50eb97dd17 | ||
|
|
dca1682386 | ||
|
|
07055e7076 | ||
|
|
2bc0df6819 | ||
|
|
33de41b4da | ||
|
|
3ae3075f25 | ||
|
|
aa6048de94 | ||
|
|
342a8177a1 | ||
|
|
179cec535c | ||
|
|
8ee31a9bf9 | ||
|
|
58165ef371 | ||
|
|
75c1706b97 | ||
|
|
e8b8974a5a | ||
|
|
ece20eaa3d | ||
|
|
38cc543177 | ||
|
|
c3ca4218ee | ||
|
|
acfff5a833 | ||
|
|
8bcf7498b5 | ||
|
|
17aff5c906 | ||
|
|
b0dfec0c23 | ||
|
|
e13805744e | ||
|
|
f185e0163c | ||
|
|
bc9f5dfc6a | ||
|
|
e36547e18b | ||
|
|
f4431d948e | ||
|
|
45404a47b2 | ||
|
|
a6dc8342f8 | ||
|
|
ae147e0bcc | ||
|
|
06394b2091 | ||
|
|
e0d8a94bf6 | ||
|
|
45cc231258 | ||
|
|
6331411c30 | ||
|
|
f8ccda6009 | ||
|
|
79c14095ed | ||
|
|
35dd0a8c14 | ||
|
|
c2c7eb0084 | ||
|
|
8252abe3ef | ||
|
|
a36800ba8a | ||
|
|
98f1272c0c | ||
|
|
050f0c9a22 | ||
|
|
205d2ae4a9 | ||
|
|
7412900e83 | ||
|
|
df7e6a94d5 | ||
|
|
9928af52cf | ||
|
|
d183e75912 | ||
|
|
74b5c48fcb | ||
|
|
a47e9ad0f8 | ||
|
|
1140a63258 | ||
|
|
df4a8d56be | ||
|
|
7c4054aaa0 | ||
|
|
bc4d108d75 | ||
|
|
b332c1d73e | ||
|
|
1ef3998cfa | ||
|
|
63e3bcce60 | ||
|
|
e10d831117 | ||
|
|
7c01dedab9 | ||
|
|
b141dc7740 | ||
|
|
1677a0e763 | ||
|
|
00c4243d50 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -52,3 +52,6 @@ application-my.yaml
|
||||
|
||||
/yudao-ui-app/unpackage/
|
||||
**/.DS_Store
|
||||
|
||||
# Generated codegen files
|
||||
/codegen/
|
||||
|
||||
38
README.md
38
README.md
@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.7.18-blue.svg" alt="Downloads">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-3.4.5-blue.svg" alt="Downloads">
|
||||
<img src="https://img.shields.io/badge/Vue-3.2-blue.svg" alt="Downloads">
|
||||
<img src="https://img.shields.io/github/license/YunaiV/ruoyi-vue-pro"/>
|
||||
<img src="https://img.shields.io/github/license/YunaiV/ruoyi-vue-pro" alt="Downloads" />
|
||||
</p>
|
||||
|
||||
**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!!**
|
||||
@ -309,26 +309,26 @@
|
||||
|
||||
| 框架 | 说明 | 版本 | 学习指南 |
|
||||
|---------------------------------------------------------------------------------------------|------------------|----------------|----------------------------------------------------------------|
|
||||
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.18 | [文档](https://github.com/YunaiV/SpringBoot-Labs) |
|
||||
| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 3.5.5 | [文档](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.23 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
|
||||
| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.7 | [文档](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) |
|
||||
| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.27 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
|
||||
| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.12 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) |
|
||||
| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 4.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) |
|
||||
| [Redis](https://redis.io/) | key-value 数据库 | 5.0 / 6.0 /7.0 | |
|
||||
| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.32.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.11 | [文档](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) |
|
||||
| [Springdoc](https://springdoc.org/) | Swagger 文档 | 1.7.0 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?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.5 | |
|
||||
| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.35.0 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) |
|
||||
| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 6.2.9 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) |
|
||||
| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 6.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) |
|
||||
| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 8.0.2 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) |
|
||||
| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 7.0.0 | [文档](https://doc.iocoder.cn/bpm/) |
|
||||
| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) |
|
||||
| [Springdoc](https://springdoc.org/) | Swagger 文档 | 2.8.9 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) |
|
||||
| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 9.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) |
|
||||
| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) |
|
||||
| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.30.14 | |
|
||||
| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.6.3 | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) |
|
||||
| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.34 | [文档](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 | - |
|
||||
| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.38 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) |
|
||||
| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.12.2 | - |
|
||||
| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 5.17.0 | - |
|
||||
|
||||
## 🐷 演示图
|
||||
|
||||
|
||||
20
pom.xml
20
pom.xml
@ -23,9 +23,9 @@
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<!-- <module>yudao-module-crm</module>-->
|
||||
<!-- <module>yudao-module-erp</module>-->
|
||||
<!-- <module>yudao-module-iot</module>-->
|
||||
<!-- AI 大模型的开启,请参考 https://doc.iocoder.cn/ai/build/ 文档,对 JDK 版本要要求! -->
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
<!-- <module>yudao-module-iot</module>-->
|
||||
<module>yudao-module-prison</module>
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
@ -33,9 +33,9 @@
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>2025.12-jdk8-SNAPSHOT</revision>
|
||||
<revision>2025.12-SNAPSHOT</revision>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>1.8</java.version>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
|
||||
@ -43,9 +43,14 @@
|
||||
<flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
|
||||
<!-- maven-surefire-plugin 暂时无法通过 bom 的依赖读取(兼容老版本 IDEA 2024 及以前版本) -->
|
||||
<lombok.version>1.18.42</lombok.version>
|
||||
<spring.boot.version>2.7.18</spring.boot.version>
|
||||
<spring.boot.version>3.5.9</spring.boot.version>
|
||||
<mapstruct.version>1.6.3</mapstruct.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<!-- 编译速度优化配置 -->
|
||||
<maven.compiler.fork>false</maven.compiler.fork>
|
||||
<maven.compiler.incremental>true</maven.compiler.incremental>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -101,6 +106,11 @@
|
||||
<version>${mapstruct.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<!-- 编译参数写在 arg 内,解决 Spring Boot 3.2 的 Parameter Name Discovery 问题 -->
|
||||
<debug>false</debug>
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@ -15,7 +15,7 @@ services:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-123456}
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql/
|
||||
- ../../sql/mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro
|
||||
- ./sql/mysql/ruoyi-vue-pro.sql:/docker-entrypoint-initdb.d/ruoyi-vue-pro.sql:ro
|
||||
|
||||
redis:
|
||||
container_name: yudao-redis
|
||||
@ -50,7 +50,7 @@ services:
|
||||
--spring.datasource.dynamic.datasource.slave.url=${SLAVE_DATASOURCE_URL:-jdbc:mysql://yudao-mysql:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true}
|
||||
--spring.datasource.dynamic.datasource.slave.username=${SLAVE_DATASOURCE_USERNAME:-root}
|
||||
--spring.datasource.dynamic.datasource.slave.password=${SLAVE_DATASOURCE_PASSWORD:-123456}
|
||||
--spring.redis.host=${REDIS_HOST:-yudao-redis}
|
||||
--spring.data.redis.host=${REDIS_HOST:-yudao-redis}
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
|
||||
171
sql/prison_dict_data.sql
Normal file
171
sql/prison_dict_data.sql
Normal file
@ -0,0 +1,171 @@
|
||||
-- ============================================
|
||||
-- 监狱管理模块字典数据
|
||||
-- ============================================
|
||||
|
||||
-- 1. 监管等级 (prison_supervision_level)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2008, '监管等级', 'prison_supervision_level', '0', '服刑人员监管等级', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(200801, 1, '严管级', '1', 'danger', '', 'prison_supervision_level', '0', '需要重点监控', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(200802, 2, '普管级', '2', 'warning', '', 'prison_supervision_level', '0', '常规管理', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(200803, 3, '宽管级', '3', 'success', '', 'prison_supervision_level', '0', '表现良好,给予更多自主权', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 2. 风险等级 (prison_risk_level)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2009, '风险等级', 'prison_risk_level', '0', '服刑人员风险等级', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(200901, 1, '低风险', '1', 'success', '', 'prison_risk_level', '0', '低风险,表现稳定', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(200902, 2, '中风险', '2', 'warning', '', 'prison_risk_level', '0', '中风险,需要定期关注', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(200903, 3, '高风险', '3', 'danger', '', 'prison_risk_level', '0', '高风险,需要重点关注', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(200904, 4, '极高风险', '4', 'danger', '', 'prison_risk_level', '0', '极高风险,需要重点监控', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 3. 服刑人员状态 (prisoner_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2010, '服刑人员状态', 'prisoner_status', '0', '服刑人员状态', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201001, 1, '在押', '1', 'primary', '', 'prisoner_status', '0', '正在服刑', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201002, 2, '假释', '2', 'warning', '', 'prisoner_status', '0', '假释期间', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201003, 3, '暂予监外执行', '3', 'info', '', 'prisoner_status', '0', '暂予监外执行', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201004, 4, '已释放', '4', 'success', '', 'prisoner_status', '0', '已刑满释放', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201005, 5, '已死亡', '5', 'danger', '', 'prisoner_status', '0', '已死亡', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 4. 文化程度 (prison_education)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2011, '文化程度', 'prison_education', '0', '服刑人员文化程度', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201101, 1, '文盲', '1', 'info', '', 'prison_education', '0', '未接受过教育', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201102, 2, '小学', '2', 'info', '', 'prison_education', '0', '小学毕业', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201103, 3, '初中', '3', 'primary', '', 'prison_education', '0', '初中毕业', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201104, 4, '高中', '4', 'primary', '', 'prison_education', '0', '高中毕业', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201105, 5, '中专', '5', 'success', '', 'prison_education', '0', '中专毕业', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201106, 6, '大专', '6', 'success', '', 'prison_education', '0', '大专毕业', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201107, 7, '本科及以上', '7', 'success', '', 'prison_education', '0', '本科及以上学历', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 5. 问卷问题类型 (prison_question_type)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2012, '问卷问题类型', 'prison_question_type', '0', '问卷问题类型', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201201, 1, '单选', '1', 'primary', '', 'prison_question_type', '0', '单选题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201202, 2, '多选', '2', 'success', '', 'prison_question_type', '0', '多选题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201203, 3, '填空', '3', 'warning', '', 'prison_question_type', '0', '填空题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201204, 4, '评分', '4', 'info', '', 'prison_question_type', '0', '评分题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201205, 5, '日期', '5', 'primary', '', 'prison_question_type', '0', '日期选择题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201206, 6, '数字', '6', 'success', '', 'prison_question_type', '0', '数字输入题', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 6. 问卷状态 (prison_questionnaire_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2013, '问卷状态', 'prison_questionnaire_status', '0', '问卷状态', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201301, 1, '草稿', '1', 'info', '', 'prison_questionnaire_status', '0', '问卷草稿', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201302, 2, '已发布', '2', 'success', '', 'prison_questionnaire_status', '0', '问卷已发布', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201303, 3, '已禁用', '3', 'danger', '', 'prison_questionnaire_status', '0', '问卷已禁用', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 6.1 问卷类型 (prison_questionnaire_type)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2021, '问卷类型', 'prison_questionnaire_type', '0', '问卷类型', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(202101, 1, '心理测评', '1', 'primary', '', 'prison_questionnaire_type', '0', '心理测评问卷', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(202102, 2, '行为评估', '2', 'warning', '', 'prison_questionnaire_type', '0', '行为评估问卷', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(202103, 3, '满意度调查', '3', 'success', '', 'prison_questionnaire_type', '0', '满意度调查问卷', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 7. 消费类型 (prison_consumption_type)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2014, '消费类型', 'prison_consumption_type', '0', '消费记录类型', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201401, 1, '购物', '1', 'success', '', 'prison_consumption_type', '0', '购物消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201402, 2, '餐饮', '2', 'primary', '', 'prison_consumption_type', '0', '餐饮消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201403, 3, '医疗', '3', 'warning', '', 'prison_consumption_type', '0', '医疗消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201404, 4, '通讯', '4', 'info', '', 'prison_consumption_type', '0', '通讯消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201405, 5, '其他', '5', 'primary', '', 'prison_consumption_type', '0', '其他消费', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 8. 消费状态 (prison_consumption_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2015, '消费状态', 'prison_consumption_status', '0', '消费记录状态', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201501, 1, '成功', '1', 'success', '', 'prison_consumption_status', '0', '交易成功', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201502, 2, '失败', '2', 'danger', '', 'prison_consumption_status', '0', '交易失败', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 9. 评估类型 (prison_assessment_type)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2016, '评估类型', 'prison_assessment_type', '0', '危险评估类型', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201601, 1, '入监评估', '1', 'primary', '', 'prison_assessment_type', '0', '入监时评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201602, 2, '定期评估', '2', 'success', '', 'prison_assessment_type', '0', '定期评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201603, 3, '专项评估', '3', 'warning', '', 'prison_assessment_type', '0', '专项评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201604, 4, '出监评估', '4', 'info', '', 'prison_assessment_type', '0', '出监时评估', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 10. 考核等级 (prison_score_level)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2017, '考核等级', 'prison_score_level', '0', '计分考核等级', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201701, 1, '优秀', '1', 'success', '', 'prison_score_level', '0', '表现优秀', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201702, 2, '良好', '2', 'primary', '', 'prison_score_level', '0', '表现良好', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201703, 3, '合格', '3', 'warning', '', 'prison_score_level', '0', '表现合格', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201704, 4, '不合格', '4', 'danger', '', 'prison_score_level', '0', '表现不合格', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 11. 考核状态 (prison_score_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2018, '考核状态', 'prison_score_status', '0', '计分考核状态', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201801, 1, '待审核', '1', 'info', '', 'prison_score_status', '0', '待审核', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201802, 2, '已通过', '2', 'success', '', 'prison_score_status', '0', '已通过审核', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201803, 3, '已驳回', '3', 'danger', '', 'prison_score_status', '0', '已驳回', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 12. 监区类型 (prison_area_type)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2019, '监区类型', 'prison_area_type', '0', '监区类型', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201901, 1, '普通监区', '1', 'primary', '', 'prison_area_type', '0', '普通管理监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201902, 2, '严管监区', '2', 'danger', '', 'prison_area_type', '0', '严格管理监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201903, 3, '医院', '3', 'success', '', 'prison_area_type', '0', '监狱医院', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201904, 4, '禁闭室', '4', 'warning', '', 'prison_area_type', '0', '禁闭室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201905, 5, '老残监区', '5', 'info', '', 'prison_area_type', '0', '老弱病残监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201906, 6, '女犯监区', '6', 'primary', '', 'prison_area_type', '0', '女性罪犯监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201907, 7, '未成年犯监区', '7', 'success', '', 'prison_area_type', '0', '未成年罪犯监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201908, 8, '出入监区', '8', 'warning', '', 'prison_area_type', '0', '新收押/释放监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201909, 9, '劳动监区', '9', 'primary', '', 'prison_area_type', '0', '劳动改造监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201910, 10, '教育监区', '10', 'success', '', 'prison_area_type', '0', '教育改造监区', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 12.1 监区级别 (prison_area_level)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2022, '监区级别', 'prison_area_level', '0', '监区级别', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(202201, 1, '监区(大队)', '1', 'primary', '', 'prison_area_level', '0', '一级监区(大队)', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(202202, 2, '分监区(中队)', '2', 'info', '', 'prison_area_level', '0', '二级监区(中队)', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 13. 监室状态 (prison_cell_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2020, '监室状态', 'prison_cell_status', '0', '监室状态', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(202001, 1, '启用', '1', 'success', '', 'prison_cell_status', '0', '监室启用', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(202002, 2, '禁用', '2', 'danger', '', 'prison_cell_status', '0', '监室禁用', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
268
sql/prison_init.sql
Normal file
268
sql/prison_init.sql
Normal file
@ -0,0 +1,268 @@
|
||||
-- ============================================
|
||||
-- XL监狱综合管理平台 - 数据库初始化脚本
|
||||
-- ============================================
|
||||
|
||||
-- 罪犯信息表
|
||||
CREATE TABLE IF NOT EXISTS `prison_prisoner` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '罪犯ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`gender` tinyint NOT NULL COMMENT '性别:1-男 2-女',
|
||||
`birthday` date DEFAULT NULL COMMENT '出生日期',
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`ethnicity` varchar(50) DEFAULT NULL COMMENT '民族',
|
||||
`native_place` varchar(100) DEFAULT NULL COMMENT '籍贯',
|
||||
`education` tinyint DEFAULT NULL COMMENT '文化程度:1-文盲 2-小学 3-初中 4-高中 5-中专 6-大专 7-本科 8-硕士 9-博士',
|
||||
`occupation` varchar(50) DEFAULT NULL COMMENT '入狱前职业',
|
||||
`address` varchar(500) DEFAULT NULL COMMENT '家庭住址',
|
||||
`crime` varchar(200) NOT NULL COMMENT '罪名',
|
||||
`sentence_years` int DEFAULT 0 COMMENT '刑期(年)',
|
||||
`sentence_months` int DEFAULT 0 COMMENT '刑期(月)',
|
||||
`life_imprisonment` tinyint DEFAULT 0 COMMENT '是否无期:0-否 1-是',
|
||||
`death_sentence_reprieve` tinyint DEFAULT 0 COMMENT '是否死缓:0-否 1-是',
|
||||
`court_name` varchar(100) DEFAULT NULL COMMENT '判决法院',
|
||||
`judgment_date` date DEFAULT NULL COMMENT '判决日期',
|
||||
`judgment_no` varchar(50) DEFAULT NULL COMMENT '判决书编号',
|
||||
`original_sentence` varchar(100) DEFAULT NULL COMMENT '原判刑期',
|
||||
`imprisonment_date` date DEFAULT NULL COMMENT '入狱日期',
|
||||
`release_date` date DEFAULT NULL COMMENT '释放日期',
|
||||
`release_type` tinyint DEFAULT 0 COMMENT '释放类型:0-未知 1-刑满释放 2-假释 3-保外就医 4-减刑 5-暂予监外执行 6-特赦 7-死亡 8-其他',
|
||||
`release_reason` varchar(500) DEFAULT NULL COMMENT '释放原因',
|
||||
`photo` varchar(512) DEFAULT NULL COMMENT '照片URL',
|
||||
`supervision_level` tinyint DEFAULT 2 COMMENT '监管等级:1-严管 2-普管 3-宽管',
|
||||
`risk_level` tinyint DEFAULT 1 COMMENT '风险等级:1-低风险 2-中风险 3-高风险 4-极高风险',
|
||||
`prison_area_id` bigint DEFAULT NULL COMMENT '监区ID',
|
||||
`sub_area_id` bigint DEFAULT NULL COMMENT '分区ID',
|
||||
`prison_cell_id` bigint DEFAULT NULL COMMENT '监室ID',
|
||||
`marital_status` tinyint DEFAULT NULL COMMENT '婚姻状态:1-未婚 2-已婚 3-离异 4-丧偶',
|
||||
`crime_type` varchar(100) DEFAULT NULL COMMENT '罪名类型',
|
||||
`sentence` varchar(100) DEFAULT NULL COMMENT '刑期',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-在押 2-已释放 3-已死亡 4-假释',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_prisoner_no` (`prisoner_no`, `tenant_id`),
|
||||
KEY `idx_name` (`name`),
|
||||
KEY `idx_id_card` (`id_card`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='罪犯信息表';
|
||||
|
||||
-- 监区信息表
|
||||
CREATE TABLE IF NOT EXISTS `prison_area` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监区ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '监区名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监区编码',
|
||||
`type` tinyint DEFAULT NULL COMMENT '监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室',
|
||||
`capacity` int DEFAULT NULL COMMENT '容纳人数',
|
||||
`current_count` int DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`),
|
||||
KEY `idx_sort` (`sort`)
|
||||
) ENGINE=InnoDB COMMENT='监区信息表';
|
||||
|
||||
-- 监室信息表
|
||||
CREATE TABLE IF NOT EXISTS `prison_cell` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监室ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`area_id` bigint NOT NULL COMMENT '所属监区ID',
|
||||
`name` varchar(50) NOT NULL COMMENT '监室名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监室编码',
|
||||
`capacity` int DEFAULT NULL COMMENT '床位数量',
|
||||
`current_count` int DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`),
|
||||
KEY `idx_area_id` (`area_id`)
|
||||
) ENGINE=InnoDB COMMENT='监室信息表';
|
||||
|
||||
-- 计分考核表
|
||||
CREATE TABLE IF NOT EXISTS `prison_score` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`year` int NOT NULL COMMENT '考核年份',
|
||||
`month` int NOT NULL COMMENT '考核月份',
|
||||
`base_score` decimal(10,2) DEFAULT 0.00 COMMENT '基础分',
|
||||
`reward_score` decimal(10,2) DEFAULT 0.00 COMMENT '加分',
|
||||
`penalty_score` decimal(10,2) DEFAULT 0.00 COMMENT '扣分',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '总分',
|
||||
`level` tinyint DEFAULT NULL COMMENT '考核等级:1-优秀 2-良好 3-合格 4-不合格',
|
||||
`assessor_id` bigint DEFAULT NULL COMMENT '考核人ID',
|
||||
`assessor_name` varchar(50) DEFAULT NULL COMMENT '考核人姓名',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待审核 2-已通过 3-已驳回',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_year_month` (`year`, `month`)
|
||||
) ENGINE=InnoDB COMMENT='计分考核表';
|
||||
|
||||
-- 危险评估表
|
||||
CREATE TABLE IF NOT EXISTS `prison_risk_assessment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评估ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`assessment_type` tinyint NOT NULL COMMENT '评估类型:1-入狱评估 2-定期评估 3-专项评估',
|
||||
`assessment_date` date NOT NULL COMMENT '评估日期',
|
||||
`violence_score` decimal(10,2) DEFAULT 0.00 COMMENT '暴力倾向得分',
|
||||
`escape_score` decimal(10,2) DEFAULT 0.00 COMMENT '脱逃倾向得分',
|
||||
`suicide_score` decimal(10,2) DEFAULT 0.00 COMMENT '自杀倾向得分',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '综合得分',
|
||||
`risk_level` tinyint NOT NULL COMMENT '风险等级:1-低风险 2-中风险 3-高风险 4-极高风险',
|
||||
`risk_factors` varchar(500) DEFAULT NULL COMMENT '风险因素',
|
||||
`suggestions` varchar(500) DEFAULT NULL COMMENT '管控建议',
|
||||
`assessor_id` bigint DEFAULT NULL COMMENT '评估人ID',
|
||||
`assessor_name` varchar(50) DEFAULT NULL COMMENT '评估人姓名',
|
||||
`next_assessment_date` date DEFAULT NULL COMMENT '下次评估日期',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待审核 2-已通过',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_assessment_date` (`assessment_date`)
|
||||
) ENGINE=InnoDB COMMENT='危险评估表';
|
||||
|
||||
-- 消费记录表
|
||||
CREATE TABLE IF NOT EXISTS `prison_consumption` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`type` tinyint NOT NULL COMMENT '类型:1-存款 2-消费 3-转账',
|
||||
`amount` decimal(12,2) NOT NULL COMMENT '金额',
|
||||
`balance` decimal(12,2) DEFAULT 0.00 COMMENT '账户余额',
|
||||
`goods_name` varchar(100) DEFAULT NULL COMMENT '商品名称',
|
||||
`goods_count` int DEFAULT 1 COMMENT '商品数量',
|
||||
`order_no` varchar(64) DEFAULT NULL COMMENT '订单号',
|
||||
`trade_time` datetime NOT NULL COMMENT '交易时间',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-成功 2-失败',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_trade_time` (`trade_time`),
|
||||
KEY `idx_type` (`type`)
|
||||
) ENGINE=InnoDB COMMENT='消费记录表';
|
||||
|
||||
-- 问卷模板表
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问卷ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(200) NOT NULL COMMENT '问卷标题',
|
||||
`type` tinyint NOT NULL COMMENT '问卷类型:1-心理测评 2-行为评估 3-满意度调查',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '问卷说明',
|
||||
`total_score` decimal(10,2) DEFAULT 100.00 COMMENT '总分',
|
||||
`pass_score` decimal(10,2) DEFAULT 60.00 COMMENT '及格分',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-草稿 2-已发布 3-已禁用',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_type` (`type`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='问卷模板表';
|
||||
|
||||
-- 问卷问题表
|
||||
CREATE TABLE IF NOT EXISTS `prison_question` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问题ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '所属问卷ID',
|
||||
`title` varchar(500) NOT NULL COMMENT '问题标题',
|
||||
`type` tinyint NOT NULL COMMENT '问题类型:1-单选 2-多选 3-填空 4-评分',
|
||||
`options` text COMMENT '选项JSON:[{label:"选项1",score:10},...]',
|
||||
`score` decimal(10,2) DEFAULT 0.00 COMMENT '分值',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`is_required` bit(1) DEFAULT b'1' 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_questionnaire_id` (`questionnaire_id`)
|
||||
) ENGINE=InnoDB COMMENT='问卷问题表';
|
||||
|
||||
-- 问卷答题记录表
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire_record` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '问卷ID',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '得分',
|
||||
`pass_status` tinyint DEFAULT NULL COMMENT '是否及格:1-及格 2-不及格',
|
||||
`answer_time` datetime NOT NULL COMMENT '答题时间',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-已完成 2-已过期',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_questionnaire_id` (`questionnaire_id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`)
|
||||
) ENGINE=InnoDB COMMENT='问卷答题记录表';
|
||||
|
||||
-- 罪犯监区变动记录表
|
||||
CREATE TABLE IF NOT EXISTS `prison_prisoner_area_log` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`from_area_id` bigint DEFAULT NULL COMMENT '原监区ID',
|
||||
`from_cell_id` bigint DEFAULT NULL COMMENT '原监室ID',
|
||||
`to_area_id` bigint NOT NULL COMMENT '新监区ID',
|
||||
`to_cell_id` bigint NOT NULL COMMENT '新监室ID',
|
||||
`change_type` varchar(20) NOT NULL COMMENT '变动类型:调监区、调监室、入监、出监',
|
||||
`reason` varchar(500) DEFAULT NULL COMMENT '变动原因',
|
||||
`approve_no` varchar(50) DEFAULT NULL COMMENT '批准文号',
|
||||
`operate_by` bigint NOT NULL COMMENT '操作人ID',
|
||||
`operate_name` varchar(50) DEFAULT NULL COMMENT '操作人姓名',
|
||||
`operate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_operate_time` (`operate_time`)
|
||||
) ENGINE=InnoDB COMMENT='罪犯监区变动记录表';
|
||||
|
||||
|
||||
45
sql/prison_inmate_schema.sql
Normal file
45
sql/prison_inmate_schema.sql
Normal file
@ -0,0 +1,45 @@
|
||||
-- ============================================
|
||||
-- 服刑人员表
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS prison_inmate;
|
||||
CREATE TABLE prison_inmate (
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
prisoner_no varchar(50) NOT NULL COMMENT '服刑人员编号',
|
||||
name varchar(50) NOT NULL COMMENT '姓名',
|
||||
gender tinyint NOT NULL COMMENT '性别:1-男,2-女',
|
||||
birthday date DEFAULT NULL COMMENT '出生日期',
|
||||
id_card varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
ethnicity varchar(50) DEFAULT '' COMMENT '民族',
|
||||
native_place varchar(100) DEFAULT '' COMMENT '籍贯',
|
||||
education tinyint DEFAULT NULL COMMENT '文化程度:1-文盲,2-小学,3-初中,4-高中,5-中专,6-大专,7-本科及以上',
|
||||
occupation varchar(100) DEFAULT '' COMMENT '职业',
|
||||
address varchar(500) DEFAULT '' COMMENT '家庭住址',
|
||||
crime varchar(200) NOT NULL COMMENT '罪名',
|
||||
sentence_years int DEFAULT 0 COMMENT '刑期(年)',
|
||||
sentence_months int DEFAULT 0 COMMENT '刑期(月)',
|
||||
imprisonment_date date DEFAULT NULL COMMENT '入狱日期',
|
||||
release_date date DEFAULT NULL COMMENT '释放日期',
|
||||
supervision_level tinyint DEFAULT NULL COMMENT '监管等级:1-严管级,2-普管级,3-宽管级',
|
||||
risk_level tinyint DEFAULT NULL COMMENT '风险等级:1-高风险,2-中风险,3-低风险',
|
||||
prison_area_id bigint DEFAULT NULL COMMENT '当前监区ID',
|
||||
prison_cell_id bigint DEFAULT NULL COMMENT '当前监室ID',
|
||||
status tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-在押,2-假释,3-暂予监外执行,4-已释放,5-已死亡',
|
||||
remark varchar(500) DEFAULT '' 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 tinyint NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||
tenant_id bigint NOT NULL DEFAULT 1 COMMENT '租户编号',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_prisoner_no (prisoner_no),
|
||||
KEY idx_name (name),
|
||||
KEY idx_id_card (id_card),
|
||||
KEY idx_prison_area_id (prison_area_id),
|
||||
KEY idx_prison_cell_id (prison_cell_id),
|
||||
KEY idx_status (status)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='服刑人员信息表';
|
||||
|
||||
-- 创建序列(如果需要)
|
||||
-- DROP SEQUENCE IF EXISTS prison_inmate_seq;
|
||||
-- CREATE SEQUENCE prison_inmate_seq START WITH 1 INCREMENT BY 1;
|
||||
56
sql/prison_sample_data.sql
Normal file
56
sql/prison_sample_data.sql
Normal file
@ -0,0 +1,56 @@
|
||||
-- ============================================
|
||||
-- 服刑人员仿真数据
|
||||
-- ============================================
|
||||
|
||||
-- 插入服刑人员数据
|
||||
INSERT INTO prison_prisoner (id, prisoner_no, name, gender, birthday, id_card, ethnicity, native_place, education, occupation, address, crime, sentence_years, sentence_months, imprisonment_date, release_date, supervision_level, risk_level, prison_area_id, prison_cell_id, status, remark, creator, create_time, updater, update_time, deleted, tenant_id)
|
||||
VALUES
|
||||
-- 1. 张三 - 盗窃罪
|
||||
(1, 'ZF2024001', '张三', 1, '1985-03-15', '310101198503151234', '汉族', '上海市', 3, '无业', '上海市徐汇区某路100号', '盗窃罪', 3, 6, '2024-01-15', '2027-07-14', 2, 1, 1, 101, 1, '多次盗窃,数额较大', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 2. 李四 - 故意伤害罪
|
||||
(2, 'ZF2024002', '李四', 1, '1990-07-22', '320101199007221234', '汉族', '江苏省南京市', 4, '工人', '南京市鼓楼区某路200号', '故意伤害罪', 5, 0, '2023-06-01', '2028-05-31', 2, 2, 1, 102, 1, '打架斗殴致人重伤', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 3. 王芳 - 诈骗罪
|
||||
(3, 'ZF2024003', '王芳', 2, '1992-11-08', '330102199211081234', '汉族', '浙江省杭州市', 5, '公司职员', '杭州市西湖区某路300号', '诈骗罪', 2, 0, '2024-03-20', '2026-03-19', 3, 3, 2, 201, 1, '电信诈骗初犯', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 4. 赵六 - 抢劫罪
|
||||
(4, 'ZF2024004', '赵六', 1, '1988-05-30', '410101198805301234', '汉族', '河南省郑州市', 2, '无业', '郑州市金水区某路400号', '抢劫罪', 8, 0, '2022-09-10', '2030-09-09', 1, 1, 1, 103, 1, '团伙抢劫累犯', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 5. 陈小明 - 贩卖毒品罪
|
||||
(5, 'ZF2024005', '陈小明', 1, '1995-01-25', '510101199501251234', '汉族', '四川省成都市', 3, '无业', '成都市武侯区某路500号', '贩卖毒品罪', 10, 0, '2021-12-01', '2031-11-30', 1, 1, 1, 104, 1, '贩卖毒品罪情节严重', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 6. 刘丽 - 职务侵占罪
|
||||
(6, 'ZF2024006', '刘丽', 2, '1987-09-12', '440101198709121234', '汉族', '广东省广州市', 6, '会计', '广州市天河区某路600号', '职务侵占罪', 3, 0, '2024-02-15', '2027-02-14', 2, 2, 2, 202, 1, '侵占公司资金', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 7. 孙强 - 交通肇事罪
|
||||
(7, 'ZF2024007', '孙强', 1, '1993-04-18', '420101199304181234', '汉族', '湖北省武汉市', 4, '司机', '武汉市江岸区某路700号', '交通肇事罪', 2, 0, '2024-05-01', '2026-04-30', 3, 3, 2, 203, 1, '醉驾致人死亡', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 8. 周雪 - 非法吸收公众存款罪
|
||||
(8, 'ZF2024008', '周雪', 2, '1980-12-03', '310101198012031234', '汉族', '上海市', 7, '金融从业者', '上海市浦东新区某路800号', '非法吸收公众存款罪', 4, 0, '2023-08-15', '2027-08-14', 2, 2, 1, 105, 1, 'P2P平台非法集资', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 9. 吴刚 - 强奸罪
|
||||
(9, 'ZF2024009', '吴刚', 1, '1998-06-28', '520101199806281234', '汉族', '贵州省贵阳市', 2, '无业', '贵阳市南明区某路900号', '强奸罪', 6, 0, '2023-03-20', '2029-03-19', 1, 1, 1, 106, 1, '强奸罪累犯', 'admin', NOW(), 'admin', NOW(), 0, 1),
|
||||
|
||||
-- 10. 郑敏 - 组织卖淫罪
|
||||
(10, 'ZF2024010', '郑敏', 2, '1983-08-15', '330102198308151234', '汉族', '浙江省宁波市', 3, '无业', '宁波市鄞州区某路1000号', '组织卖淫罪', 5, 0, '2023-11-01', '2028-10-31', 1, 1, 2, 204, 1, '组织卖淫团伙头目', 'admin', NOW(), 'admin', NOW(), 0, 1);
|
||||
|
||||
-- 插入监区数据
|
||||
INSERT INTO prison_area (id, tenant_id, name, code, type, capacity, current_count, sort, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(1, 1, '第一监区', 'AREA001', 1, 100, 50, 1, 1, '普通监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(2, 1, '第二监区', 'AREA002', 1, 100, 30, 2, 1, '普通监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(3, 1, '严管监区', 'AREA003', 2, 50, 20, 3, 1, '严管监区', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 插入监室数据
|
||||
INSERT INTO prison_cell (id, tenant_id, area_id, name, code, capacity, current_count, sort, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(101, 1, 1, '101室', 'CELL101', 10, 8, 1, 1, '第一监区第一室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(102, 1, 1, '102室', 'CELL102', 10, 7, 2, 1, '第一监区第二室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(103, 1, 1, '103室', 'CELL103', 10, 5, 3, 1, '第一监区第三室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(104, 1, 1, '104室', 'CELL104', 10, 6, 4, 1, '第一监区第四室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(105, 1, 1, '105室', 'CELL105', 10, 4, 5, 1, '第一监区第五室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201, 1, 2, '201室', 'CELL201', 10, 5, 1, 1, '第二监区第一室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(202, 1, 2, '202室', 'CELL202', 10, 6, 2, 1, '第二监区第二室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(203, 1, 2, '203室', 'CELL203', 10, 4, 3, 1, '第二监区第三室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(204, 1, 2, '204室', 'CELL204', 10, 5, 4, 1, '第二监区第四室', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
15
sql/upgrade_prison_score_add_area_cell_fields_20260119.sql
Normal file
15
sql/upgrade_prison_score_add_area_cell_fields_20260119.sql
Normal file
@ -0,0 +1,15 @@
|
||||
-- 升级脚本:为 prison_score 表添加 prison_area_id 和 prison_cell_id 字段
|
||||
-- 执行时间:2026-01-19
|
||||
|
||||
-- 为 prison_score 表添加 prison_area_id 字段
|
||||
ALTER TABLE `prison_score`
|
||||
ADD COLUMN `prison_area_id` bigint DEFAULT NULL COMMENT '监区ID' AFTER `remark`;
|
||||
|
||||
-- 为 prison_score 表添加 prison_cell_id 字段
|
||||
ALTER TABLE `prison_score`
|
||||
ADD COLUMN `prison_cell_id` bigint DEFAULT NULL COMMENT '监室ID' AFTER `prison_area_id`;
|
||||
|
||||
-- 添加索引(可选,如果查询频繁需要的话)
|
||||
ALTER TABLE `prison_score`
|
||||
ADD KEY `idx_prison_score_prison_area_id` (`prison_area_id`),
|
||||
ADD KEY `idx_prison_score_prison_cell_id` (`prison_cell_id`);
|
||||
73
sql/upgrade_questionnaire_20260113.sql
Normal file
73
sql/upgrade_questionnaire_20260113.sql
Normal file
@ -0,0 +1,73 @@
|
||||
-- =====================================================
|
||||
-- XL监狱综合管理平台 - 问卷系统增强脚本
|
||||
-- 执行日期:2026-01-13
|
||||
-- =====================================================
|
||||
|
||||
-- 切换到目标数据库
|
||||
USE xlcp_dev;
|
||||
|
||||
-- =====================================================
|
||||
-- 1. 问题表 (prison_question) 新增字段
|
||||
-- =====================================================
|
||||
ALTER TABLE prison_question
|
||||
ADD COLUMN part_name VARCHAR(100) COMMENT '分区名称(Part名称),用于将问题分组' AFTER is_required,
|
||||
ADD COLUMN part_sort INT DEFAULT 0 COMMENT '分区排序(同一问卷内的分区序号)' AFTER part_name,
|
||||
ADD COLUMN help_text VARCHAR(500) COMMENT '帮助说明文字' AFTER part_sort,
|
||||
ADD COLUMN placeholder VARCHAR(200) COMMENT '占位提示(填空题/数字题显示)' AFTER help_text,
|
||||
ADD COLUMN default_value VARCHAR(200) COMMENT '默认值' AFTER placeholder,
|
||||
ADD COLUMN auto_fill_type VARCHAR(20) DEFAULT 'NONE' COMMENT '自动填充类型:NONE-无 AUTO-系统自动填充 MANUAL-手动输入' AFTER default_value,
|
||||
ADD COLUMN auto_fill_source VARCHAR(100) COMMENT '自动填充来源:dict:字典类型 / field:字段名 示例:dict:system_user_sex 或 field:prisonerName' AFTER auto_fill_type,
|
||||
ADD COLUMN display_condition VARCHAR(500) COMMENT '显示条件JSON:{\"field\":\"字段名\",\"operator\":\">=\",\"value\":\"值\"} 示例:{\"field\":\"riskLevel\",\"operator\":\">=\",\"value\":\"3\"}' AFTER auto_fill_source,
|
||||
ADD COLUMN min_value INT COMMENT '最小值(数字/评分题)' AFTER display_condition,
|
||||
ADD COLUMN max_value INT COMMENT '最大值(数字/评分题)' AFTER min_value;
|
||||
|
||||
-- =====================================================
|
||||
-- 2. 问卷表 (prison_questionnaire) 新增字段
|
||||
-- =====================================================
|
||||
ALTER TABLE prison_questionnaire
|
||||
ADD COLUMN cover_image VARCHAR(500) COMMENT '封面图片URL' AFTER status,
|
||||
ADD COLUMN instruction VARCHAR(1000) COMMENT '填写说明' AFTER cover_image,
|
||||
ADD COLUMN estimated_time INT COMMENT '预计耗时(分钟)' AFTER instruction,
|
||||
ADD COLUMN part_count INT DEFAULT 0 COMMENT '分区数量' AFTER estimated_time,
|
||||
ADD COLUMN allow_anonymous TINYINT(1) DEFAULT 1 COMMENT '是否允许匿名:0-否 1-是' AFTER part_count;
|
||||
|
||||
-- =====================================================
|
||||
-- 3. 验证脚本 - 查看新增字段
|
||||
-- =====================================================
|
||||
SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = 'xlcp_dev'
|
||||
AND TABLE_NAME = 'prison_question'
|
||||
AND COLUMN_NAME LIKE 'part_%'
|
||||
OR COLUMN_NAME = 'help_text'
|
||||
OR COLUMN_NAME = 'placeholder'
|
||||
OR COLUMN_NAME = 'default_value'
|
||||
OR COLUMN_NAME LIKE 'auto_%'
|
||||
OR COLUMN_NAME = 'display_condition'
|
||||
OR COLUMN_NAME IN ('min_value', 'max_value')
|
||||
ORDER BY ORDINAL_POSITION;
|
||||
|
||||
SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = 'xlcp_dev'
|
||||
AND TABLE_NAME = 'prison_questionnaire'
|
||||
AND COLUMN_NAME IN ('cover_image', 'instruction', 'estimated_time', 'part_count', 'allow_anonymous')
|
||||
ORDER BY ORDINAL_POSITION;
|
||||
|
||||
-- =====================================================
|
||||
-- 4. 问题类型字典数据(如果需要)
|
||||
-- =====================================================
|
||||
-- 问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字
|
||||
-- INSERT INTO system_dict_data (dict_type, dict_value, dict_label, sort_order, status)
|
||||
-- VALUES ('prison_question_type', '5', '日期', 5, '0'),
|
||||
-- ('prison_question_type', '6', '数字', 6, '0');
|
||||
|
||||
-- =====================================================
|
||||
-- 5. 自动填充类型字典数据
|
||||
-- =====================================================
|
||||
-- INSERT INTO system_dict_data (dict_type, dict_value, dict_label, sort_order, status)
|
||||
-- VALUES ('question_auto_fill_type', 'NONE', '无', 1, '0'),
|
||||
-- ('question_auto_fill_type', 'AUTO', '系统自动填充', 2, '0'),
|
||||
-- ('question_auto_fill_type', 'MANUAL', '手动输入', 3, '0');
|
||||
|
||||
SELECT '脚本执行完成!请验证字段是否添加成功。' AS RESULT;
|
||||
68
sql/upgrade_questionnaire_auto_fill_source_20260113.sql
Normal file
68
sql/upgrade_questionnaire_auto_fill_source_20260113.sql
Normal file
@ -0,0 +1,68 @@
|
||||
-- =====================================================
|
||||
-- XL监狱综合管理平台 - 问卷自动填充来源字典
|
||||
-- 执行日期:2026-01-13
|
||||
-- =====================================================
|
||||
|
||||
-- 切换到目标数据库
|
||||
USE xlcp_dev;
|
||||
|
||||
-- =====================================================
|
||||
-- 1. 自动填充来源字典类型
|
||||
-- =====================================================
|
||||
INSERT INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES (2100, '问卷自动填充来源', 'prison_question_auto_fill_source', '0', '问卷问题自动填充来源配置', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- =====================================================
|
||||
-- 2. 自动填充来源字典数据
|
||||
-- =====================================================
|
||||
|
||||
-- 罪犯基本信息类(field: 前缀)
|
||||
INSERT INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
-- 罪犯基本信息 (ID: 210101-210110)
|
||||
(210101, 1, '罪犯姓名', 'field:prisonerName', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取姓名', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210102, 2, '罪犯编号', 'field:prisonerNo', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取编号', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210103, 3, '年龄', 'field:age', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息计算年龄', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210104, 4, '性别', 'field:gender', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取性别', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210105, 5, '民族', 'field:nation', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取民族', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210106, 6, '文化程度', 'field:education', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取文化程度', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210107, 7, '出生日期', 'field:birthDate', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取出生日期', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210108, 8, '籍贯', 'field:nativePlace', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取籍贯', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210109, 9, '身份证号', 'field:idCard', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取身份证号', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210110, 10, '家庭住址', 'field:address', '', '', 'prison_question_auto_fill_source', '0', '从罪犯基本信息获取家庭住址', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
|
||||
-- 狱政管理类 (ID: 210120-210128)
|
||||
(210120, 20, '监管等级', 'field:supervisionLevel', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取监管等级', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210121, 21, '风险等级', 'field:riskLevel', '', '', 'prison_question_auto_fill_source', '0', '从危评系统获取风险等级', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210122, 22, '在押时长(月)', 'field:months', '', '', 'prison_question_auto_fill_source', '0', '计算在押时长(月)', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210123, 23, '入监日期', 'field:admissionDate', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取入监日期', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210124, 24, '预计出监日期', 'field:releaseDate', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取预计出监日期', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210125, 25, '刑期(年)', 'field:sentenceYears', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取刑期', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210126, 26, '犯罪类型', 'field:crimeType', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取犯罪类型', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210127, 27, '所在监区', 'field:prisonArea', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取所在监区', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210128, 28, '所在监室', 'field:prisonCell', '', '', 'prison_question_auto_fill_source', '0', '从狱政管理获取所在监室', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
|
||||
-- 考核评估类 (ID: 210140-210145)
|
||||
(210140, 40, '当前总分', 'field:totalScore', '', '', 'prison_question_auto_fill_source', '0', '从计分考核获取当前总分', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210141, 41, '本月得分', 'field:monthScore', '', '', 'prison_question_auto_fill_source', '0', '从计分考核获取本月得分', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210142, 42, '本年累计得分', 'field:yearScore', '', '', 'prison_question_auto_fill_source', '0', '从计分考核获取本年累计得分', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210143, 43, '评估次数', 'field:assessmentCount', '', '', 'prison_question_auto_fill_source', '0', '从危评系统获取评估次数', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210144, 44, '上次评估日期', 'field:lastAssessmentDate', '', '', 'prison_question_auto_fill_source', '0', '从危评系统获取上次评估日期', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210145, 45, '考核等级', 'field:scoreLevel', '', '', 'prison_question_auto_fill_source', '0', '从计分考核获取考核等级', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
|
||||
-- 系统字典类(dict: 前缀)(ID: 210160-210164)
|
||||
(210160, 60, '性别(字典)', 'dict:system_user_sex', '', '', 'prison_question_auto_fill_source', '0', '从系统字典获取性别选项', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210161, 61, '监管等级(字典)', 'dict:prison_supervision_level', '', '', 'prison_question_auto_fill_source', '0', '从系统字典获取监管等级选项', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210162, 62, '风险等级(字典)', 'dict:prison_risk_level', '', '', 'prison_question_auto_fill_source', '0', '从系统字典获取风险等级选项', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210163, 63, '文化程度(字典)', 'dict:prison_education', '', '', 'prison_question_auto_fill_source', '0', '从系统字典获取文化程度选项', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(210164, 64, '考核等级(字典)', 'dict:prison_score_level', '', '', 'prison_question_auto_fill_source', '0', '从系统字典获取考核等级选项', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- =====================================================
|
||||
-- 3. 验证脚本 - 查看新增字典数据
|
||||
-- =====================================================
|
||||
SELECT id, sort, label, value, dict_type, status
|
||||
FROM system_dict_data
|
||||
WHERE dict_type = 'prison_question_auto_fill_source'
|
||||
ORDER BY sort;
|
||||
|
||||
SELECT '字典数据插入完成!请在系统管理-字典管理中查看并启用。' AS RESULT;
|
||||
793
sql/v1_migration_20260121.sql
Normal file
793
sql/v1_migration_20260121.sql
Normal file
@ -0,0 +1,793 @@
|
||||
-- ============================================
|
||||
-- XL监狱综合管理平台 - 数据库迁移脚本 V1
|
||||
-- 版本: 1.0
|
||||
-- 日期: 2026-01-21
|
||||
-- 说明: 基于实体类DO生成,包含所有表的完整字段定义
|
||||
-- ============================================
|
||||
|
||||
-- 开启外键检查(可选,根据需求调整)
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ============================================
|
||||
-- 1. 罪犯信息表 (prison_prisoner)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_prisoner`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_prisoner` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '罪犯ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`gender` tinyint NOT NULL COMMENT '性别:1-男 2-女',
|
||||
`birthday` date DEFAULT NULL COMMENT '出生日期',
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`ethnicity` varchar(50) DEFAULT NULL COMMENT '民族',
|
||||
`native_place` varchar(100) DEFAULT NULL COMMENT '籍贯',
|
||||
`education` tinyint DEFAULT NULL COMMENT '文化程度:1-文盲 2-小学 3-初中 4-高中 5-中专 6-大专 7-本科 8-硕士 9-博士',
|
||||
`occupation` varchar(50) DEFAULT NULL COMMENT '入狱前职业',
|
||||
`address` varchar(500) DEFAULT NULL COMMENT '家庭住址',
|
||||
`crime` varchar(200) NOT NULL COMMENT '罪名',
|
||||
`sentence_years` int DEFAULT 0 COMMENT '刑期(年)',
|
||||
`sentence_months` int DEFAULT 0 COMMENT '刑期(月)',
|
||||
`life_imprisonment` tinyint DEFAULT 0 COMMENT '是否无期:0-否 1-是',
|
||||
`death_sentence_reprieve` tinyint DEFAULT 0 COMMENT '是否死缓:0-否 1-是',
|
||||
`court_name` varchar(100) DEFAULT NULL COMMENT '判决法院',
|
||||
`judgment_date` date DEFAULT NULL COMMENT '判决日期',
|
||||
`judgment_no` varchar(50) DEFAULT NULL COMMENT '判决书编号',
|
||||
`original_sentence` varchar(100) DEFAULT NULL COMMENT '原判刑期',
|
||||
`imprisonment_date` date DEFAULT NULL COMMENT '入狱日期',
|
||||
`release_date` date DEFAULT NULL COMMENT '释放日期',
|
||||
`release_type` tinyint DEFAULT 0 COMMENT '释放类型:1-刑满 2-假释 3-暂予监外执行 4-减刑 5-移交 6-死亡',
|
||||
`release_reason` varchar(500) DEFAULT NULL COMMENT '释放原因',
|
||||
`photo` varchar(512) DEFAULT NULL COMMENT '照片URL',
|
||||
`supervision_level` tinyint DEFAULT 2 COMMENT '监管等级:1-严管 2-普管 3-宽管',
|
||||
`risk_level` tinyint DEFAULT 1 COMMENT '风险等级:1-低风险 2-中风险 3-高风险 4-极高风险',
|
||||
`prison_area_id` bigint DEFAULT NULL COMMENT '监区ID',
|
||||
`sub_area_id` bigint DEFAULT NULL COMMENT '分区ID',
|
||||
`prison_cell_id` bigint DEFAULT NULL COMMENT '监室ID',
|
||||
`marital_status` tinyint DEFAULT NULL COMMENT '婚姻状态:1-未婚 2-已婚 3-离异 4-丧偶',
|
||||
`crime_type` varchar(100) DEFAULT NULL COMMENT '罪名类型',
|
||||
`sentence` varchar(100) DEFAULT NULL COMMENT '刑期',
|
||||
`children` varchar(500) DEFAULT NULL COMMENT '子女情况',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-在押 2-已释放 3-已死亡 4-假释',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_prisoner_no` (`prisoner_no`, `tenant_id`),
|
||||
KEY `idx_name` (`name`),
|
||||
KEY `idx_id_card` (`id_card`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='罪犯信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 2. 监区信息表 (prison_area)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_area`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_area` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监区ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '监区名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监区编码',
|
||||
`type` tinyint DEFAULT NULL COMMENT '监区类型:1-普通监区 2-严管监区 3-集训监区 4-出监监区 5-医院 6-禁闭室',
|
||||
`parent_id` bigint DEFAULT 0 COMMENT '父级ID,0表示顶级监区',
|
||||
`level` tinyint DEFAULT 1 COMMENT '级别:1-监区(大队) 2-分监区(中队)',
|
||||
`capacity` int DEFAULT NULL COMMENT '容纳人数',
|
||||
`current_count` int DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`),
|
||||
KEY `idx_sort` (`sort`),
|
||||
KEY `idx_parent_id` (`parent_id`)
|
||||
) ENGINE=InnoDB COMMENT='监区信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 3. 监室信息表 (prison_cell)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_cell`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_cell` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监室ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`area_id` bigint NOT NULL COMMENT '所属监区ID',
|
||||
`name` varchar(50) NOT NULL COMMENT '监室名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监室编码',
|
||||
`capacity` int DEFAULT NULL COMMENT '床位数量',
|
||||
`current_count` int DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`),
|
||||
KEY `idx_area_id` (`area_id`)
|
||||
) ENGINE=InnoDB COMMENT='监室信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 4. 计分考核表 (prison_score)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_score`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_score` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`year` int NOT NULL COMMENT '考核年份',
|
||||
`month` int NOT NULL COMMENT '考核月份',
|
||||
`base_score` decimal(10,2) DEFAULT 0.00 COMMENT '基础分',
|
||||
`reward_score` decimal(10,2) DEFAULT 0.00 COMMENT '加分',
|
||||
`penalty_score` decimal(10,2) DEFAULT 0.00 COMMENT '扣分',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '总分',
|
||||
`level` tinyint DEFAULT NULL COMMENT '考核等级:1-优秀 2-良好 3-合格 4-不合格',
|
||||
`assessor_id` bigint DEFAULT NULL COMMENT '考核人ID',
|
||||
`assessor_name` varchar(50) DEFAULT NULL COMMENT '考核人姓名',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待审核 2-已通过 3-已驳回',
|
||||
`prison_area_id` bigint DEFAULT NULL COMMENT '监区ID',
|
||||
`prison_cell_id` bigint DEFAULT NULL COMMENT '监室ID',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_year_month` (`year`, `month`)
|
||||
) ENGINE=InnoDB COMMENT='计分考核表';
|
||||
|
||||
-- ============================================
|
||||
-- 5. 考核规则配置表 (prison_score_rule)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_score_rule`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_score_rule` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '规则ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`category` tinyint NOT NULL COMMENT '类别:1-劳动改造 2-教育改造 3-日常行为 4-卫生纪律 5-加分项 6-扣分项',
|
||||
`item_name` varchar(100) NOT NULL COMMENT '项目名称',
|
||||
`item_code` varchar(50) NOT NULL COMMENT '项目编码(唯一)',
|
||||
`score` decimal(10,2) NOT NULL COMMENT '分值(加分正数,扣分负数)',
|
||||
`max_daily_score` decimal(10,2) DEFAULT NULL COMMENT '日最高分限制',
|
||||
`max_monthly_score` decimal(10,2) DEFAULT NULL COMMENT '月最高分限制',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '规则说明',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`sort` int DEFAULT 0 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_item_code` (`item_code`, `tenant_id`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='考核规则配置表';
|
||||
|
||||
-- ============================================
|
||||
-- 6. 考核记录明细表 (prison_score_detail)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_score_detail`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_score_detail` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`record_date` date NOT NULL COMMENT '记录日期',
|
||||
`rule_id` bigint DEFAULT NULL COMMENT '规则ID',
|
||||
`score` decimal(10,2) NOT NULL COMMENT '得分',
|
||||
`score_type` tinyint NOT NULL COMMENT '类型:1-加分 2-扣分',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`recorder_id` bigint DEFAULT NULL COMMENT '记录人ID',
|
||||
`recorder_name` varchar(50) DEFAULT NULL COMMENT '记录人姓名',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-有效 2-作废',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_record_date` (`record_date`),
|
||||
KEY `idx_rule_id` (`rule_id`)
|
||||
) ENGINE=InnoDB COMMENT='考核记录明细表';
|
||||
|
||||
-- ============================================
|
||||
-- 7. 危险评估表 (prison_risk_assessment)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_risk_assessment`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_risk_assessment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评估ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`assessment_type` tinyint NOT NULL COMMENT '评估类型:1-入狱评估 2-定期评估 3-专项评估',
|
||||
`assessment_date` date NOT NULL COMMENT '评估日期',
|
||||
`violence_score` decimal(10,2) DEFAULT 0.00 COMMENT '暴力倾向得分',
|
||||
`escape_score` decimal(10,2) DEFAULT 0.00 COMMENT '脱逃倾向得分',
|
||||
`suicide_score` decimal(10,2) DEFAULT 0.00 COMMENT '自杀倾向得分',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '综合得分',
|
||||
`risk_level` tinyint NOT NULL COMMENT '风险等级:1-低风险 2-中风险 3-高风险 4-极高风险',
|
||||
`risk_factors` varchar(500) DEFAULT NULL COMMENT '风险因素',
|
||||
`suggestions` varchar(500) DEFAULT NULL COMMENT '管控建议',
|
||||
`assessor_id` bigint DEFAULT NULL COMMENT '评估人ID',
|
||||
`assessor_name` varchar(50) DEFAULT NULL COMMENT '评估人姓名',
|
||||
`next_assessment_date` date DEFAULT NULL COMMENT '下次评估日期',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待审核 2-已通过',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_assessment_date` (`assessment_date`)
|
||||
) ENGINE=InnoDB COMMENT='危险评估表';
|
||||
|
||||
-- ============================================
|
||||
-- 8. 消费记录表 (prison_consumption)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_consumption`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_consumption` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '消费ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`order_no` varchar(64) DEFAULT NULL COMMENT '订单号',
|
||||
`type` tinyint NOT NULL COMMENT '类型:1-购物 2-餐饮 3-医疗 4-通讯 5-其他',
|
||||
`total_amount` decimal(12,2) NOT NULL COMMENT '订单总金额',
|
||||
`balance` decimal(12,2) DEFAULT 0.00 COMMENT '账户余额(消费后)',
|
||||
`trade_time` datetime NOT NULL COMMENT '交易时间',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-成功 2-失败',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_trade_time` (`trade_time`),
|
||||
KEY `idx_type` (`type`)
|
||||
) ENGINE=InnoDB COMMENT='消费记录表';
|
||||
|
||||
-- ============================================
|
||||
-- 9. 问卷模板表 (prison_questionnaire)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_questionnaire`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问卷ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(200) NOT NULL COMMENT '问卷标题',
|
||||
`type` tinyint NOT NULL COMMENT '问卷类型:1-心理测评 2-行为评估 3-满意度调查',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '问卷说明',
|
||||
`total_score` decimal(10,2) DEFAULT 100.00 COMMENT '总分',
|
||||
`pass_score` decimal(10,2) DEFAULT 60.00 COMMENT '及格分',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-草稿 2-已发布 3-已禁用',
|
||||
`cover_image` varchar(500) DEFAULT NULL COMMENT '封面图片URL',
|
||||
`instruction` varchar(1000) DEFAULT NULL COMMENT '填写说明',
|
||||
`estimated_time` int DEFAULT NULL COMMENT '预计耗时(分钟)',
|
||||
`part_count` tinyint DEFAULT 1 COMMENT '分区数量',
|
||||
`allow_anonymous` tinyint DEFAULT 0 COMMENT '是否允许匿名:0-不允许 1-允许',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_type` (`type`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='问卷模板表';
|
||||
|
||||
-- ============================================
|
||||
-- 10. 问卷问题表 (prison_question)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_question`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_question` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问题ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '所属问卷ID',
|
||||
`title` varchar(500) NOT NULL COMMENT '问题标题',
|
||||
`type` tinyint NOT NULL COMMENT '问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字',
|
||||
`options` text COMMENT '选项JSON:[{label:"选项1",score:10,isOther:false},...]',
|
||||
`score` decimal(10,2) DEFAULT 0.00 COMMENT '分值',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`is_required` tinyint DEFAULT 1 COMMENT '是否必答:0-否 1-是',
|
||||
`part_name` varchar(50) DEFAULT NULL COMMENT '分区名称(Part名称),用于将问题分组',
|
||||
`part_sort` tinyint DEFAULT 0 COMMENT '分区排序(同一问卷内的分区序号)',
|
||||
`help_text` varchar(500) DEFAULT NULL COMMENT '帮助说明文字',
|
||||
`placeholder` varchar(200) DEFAULT NULL COMMENT '占位提示(填空题/数字题显示)',
|
||||
`default_value` varchar(200) DEFAULT NULL COMMENT '默认值',
|
||||
`auto_fill_type` varchar(20) DEFAULT 'NONE' COMMENT '自动填充类型:NONE-无 AUTO-系统自动填充 MANUAL-手动输入',
|
||||
`auto_fill_source` varchar(100) DEFAULT NULL COMMENT '自动填充来源:dict:字典类型 / field:字段名',
|
||||
`display_condition` text COMMENT '显示条件JSON:{"field":"字段名","operator":">=","value":"值"}',
|
||||
`min_value` int DEFAULT NULL COMMENT '最小值(数字/评分题)',
|
||||
`max_value` int DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_questionnaire_id` (`questionnaire_id`)
|
||||
) ENGINE=InnoDB COMMENT='问卷问题表';
|
||||
|
||||
-- ============================================
|
||||
-- 11. 问卷答题记录表 (prison_questionnaire_record)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_questionnaire_record`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire_record` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '问卷ID',
|
||||
`questionnaire_name` varchar(200) DEFAULT NULL COMMENT '问卷名称',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`prisoner_name` varchar(50) DEFAULT NULL COMMENT '罪犯姓名',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待测评 2-测评中 3-已完成 4-已过期 5-已取消',
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
|
||||
`answer_time` datetime DEFAULT NULL COMMENT '答题时间',
|
||||
`deadline` datetime DEFAULT NULL COMMENT '截止日期',
|
||||
`objective_score` decimal(10,2) DEFAULT 0.00 COMMENT '客观题得分',
|
||||
`subjective_score` decimal(10,2) DEFAULT 0.00 COMMENT '主观题得分',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '总分',
|
||||
`pass_score` decimal(10,2) DEFAULT NULL COMMENT '及格分数',
|
||||
`pass_status` tinyint DEFAULT NULL COMMENT '及格状态:1-及格 2-不及格 3-待评阅',
|
||||
`risk_level` tinyint DEFAULT NULL COMMENT '风险等级:1-高风险 2-中风险 3-低风险',
|
||||
`evaluator_id` bigint DEFAULT NULL COMMENT '评阅人ID',
|
||||
`evaluator_name` varchar(50) DEFAULT NULL COMMENT '评阅人姓名',
|
||||
`evaluate_time` datetime DEFAULT NULL COMMENT '评阅时间',
|
||||
`participant_count` int DEFAULT 0 COMMENT '参与人数',
|
||||
`completed_count` int DEFAULT 0 COMMENT '完成人数',
|
||||
`duration` int DEFAULT 0 COMMENT '答题用时(秒)',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_questionnaire_id` (`questionnaire_id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='问卷答题记录表';
|
||||
|
||||
-- ============================================
|
||||
-- 12. 问卷答题详情表 (prison_answer)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_answer`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_answer` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '答题记录ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`assessment_record_id` bigint NOT NULL COMMENT '测评记录ID',
|
||||
`question_id` bigint NOT NULL COMMENT '问题ID',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '问卷ID(冗余)',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`question_type` tinyint NOT NULL COMMENT '问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字',
|
||||
`answer_text` text COMMENT '答案内容(填空题、评分题等)',
|
||||
`option_ids` text COMMENT '选项ID列表(JSON数组,如 [1,2,3])',
|
||||
`score` decimal(10,2) DEFAULT 0.00 COMMENT '得分',
|
||||
`is_correct` tinyint DEFAULT NULL COMMENT '是否正确:null-未评分 0-错误 1-正确',
|
||||
`duration` int DEFAULT 0 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_assessment_record_id` (`assessment_record_id`),
|
||||
KEY `idx_question_id` (`question_id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`)
|
||||
) ENGINE=InnoDB COMMENT='问卷答题详情表';
|
||||
|
||||
-- ============================================
|
||||
-- 13. 罪犯监区变动记录表 (prison_prisoner_area_log)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_prisoner_area_log`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_prisoner_area_log` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`from_area_id` bigint DEFAULT NULL COMMENT '原监区ID',
|
||||
`from_sub_area_id` bigint DEFAULT NULL COMMENT '原分监区ID',
|
||||
`from_cell_id` bigint DEFAULT NULL COMMENT '原监室ID',
|
||||
`to_area_id` bigint NOT NULL COMMENT '新监区ID',
|
||||
`to_sub_area_id` bigint DEFAULT NULL COMMENT '新分监区ID',
|
||||
`to_cell_id` bigint NOT NULL COMMENT '新监室ID',
|
||||
`change_type` tinyint NOT NULL COMMENT '变动类型:1-调入 2-调出 3-临时安置 4-医疗回监 5-初始分配',
|
||||
`reason` varchar(500) DEFAULT NULL COMMENT '变动原因',
|
||||
`approve_no` varchar(50) DEFAULT NULL COMMENT '批准文号',
|
||||
`operate_by` bigint NOT NULL COMMENT '操作人ID',
|
||||
`operate_name` varchar(50) DEFAULT NULL COMMENT '操作人姓名',
|
||||
`operate_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_operate_time` (`operate_time`)
|
||||
) ENGINE=InnoDB COMMENT='罪犯监区变动记录表';
|
||||
|
||||
-- ============================================
|
||||
-- 14. 预警信息表 (prison_warning)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_warning`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_warning` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '预警ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(200) NOT NULL COMMENT '预警标题',
|
||||
`content` text COMMENT '预警内容',
|
||||
`type` tinyint NOT NULL COMMENT '预警类型:1-安全预警 2-监管预警 3-改造预警 4-生产预警 5-生活卫生预警 6-其他',
|
||||
`level` tinyint NOT NULL COMMENT '预警等级:1-一般 2-重要 3-紧急 4-严重',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '预警状态:1-待核实 2-已核实 3-已处置 4-已解除',
|
||||
`source` tinyint DEFAULT NULL COMMENT '预警来源:1-民警报告 2-监控系统 3-举报 4-罪犯自首 5-智能分析 6-其他',
|
||||
`situation_id` bigint DEFAULT NULL COMMENT '关联狱情ID',
|
||||
`area_id` bigint DEFAULT NULL COMMENT '关联监区ID',
|
||||
`cell_id` bigint DEFAULT NULL COMMENT '关联监室ID',
|
||||
`alert_time` datetime NOT NULL COMMENT '预警时间',
|
||||
`verify_time` datetime DEFAULT NULL COMMENT '核实时间',
|
||||
`verifier` varchar(50) DEFAULT NULL COMMENT '核实人',
|
||||
`verify_result` varchar(500) DEFAULT NULL COMMENT '核实结果',
|
||||
`handle_time` datetime DEFAULT NULL COMMENT '处置时间',
|
||||
`handler` varchar(50) DEFAULT NULL COMMENT '处置人',
|
||||
`handle_method` varchar(200) DEFAULT NULL COMMENT '处置方式',
|
||||
`handle_result` varchar(500) DEFAULT NULL COMMENT '处置结果',
|
||||
`release_time` datetime DEFAULT NULL COMMENT '解除时间',
|
||||
`releaser` varchar(50) DEFAULT NULL COMMENT '解除人',
|
||||
`release_reason` varchar(500) DEFAULT NULL COMMENT '解除原因',
|
||||
`occur_time` datetime DEFAULT NULL COMMENT '发生时间',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_type` (`type`),
|
||||
KEY `idx_level` (`level`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_area_id` (`area_id`),
|
||||
KEY `idx_alert_time` (`alert_time`)
|
||||
) ENGINE=InnoDB COMMENT='预警信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 15. 狱情收集信息表 (prison_situation)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_situation`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_situation` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '狱情ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(200) NOT NULL COMMENT '标题',
|
||||
`content` text COMMENT '详情内容',
|
||||
`category` tinyint NOT NULL COMMENT '分类:1-监管安全 2-教育改造 3-生活卫生 4-生产安全 5-狱内案件 6-其他',
|
||||
`level` tinyint NOT NULL COMMENT '等级:1-一般 2-重要 3-紧急',
|
||||
`source` tinyint DEFAULT NULL COMMENT '来源:1-民警报告 2-监控系统 3-举报 4-罪犯自首 5-其他',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '处理状态:1-待处理 2-处理中 3-已处理',
|
||||
`area_id` bigint DEFAULT NULL COMMENT '关联监区ID',
|
||||
`cell_id` bigint DEFAULT NULL COMMENT '关联监室ID',
|
||||
`reporter` varchar(50) DEFAULT NULL COMMENT '报告人',
|
||||
`handler` varchar(50) DEFAULT NULL COMMENT '处理人',
|
||||
`handle_time` datetime DEFAULT NULL COMMENT '处理时间',
|
||||
`handle_result` varchar(500) DEFAULT NULL COMMENT '处理结果',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`occur_time` datetime DEFAULT NULL COMMENT '发生时间',
|
||||
`type` varchar(50) DEFAULT NULL COMMENT '类型',
|
||||
`location` varchar(200) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_category` (`category`),
|
||||
KEY `idx_level` (`level`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_area_id` (`area_id`),
|
||||
KEY `idx_occur_time` (`occur_time`)
|
||||
) ENGINE=InnoDB COMMENT='狱情收集信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 16. 评估报告表 (prison_evaluation_report)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_evaluation_report`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_evaluation_report` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '报告ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`report_no` varchar(50) NOT NULL COMMENT '报告编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`prisoner_name` varchar(50) DEFAULT NULL COMMENT '罪犯姓名',
|
||||
`template_id` bigint DEFAULT NULL COMMENT '模板ID',
|
||||
`template_name` varchar(100) DEFAULT NULL COMMENT '模板名称',
|
||||
`evaluation_type` tinyint DEFAULT NULL COMMENT '评估类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估',
|
||||
`evaluation_cycle` tinyint DEFAULT NULL COMMENT '评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估',
|
||||
`evaluation_date` datetime DEFAULT NULL COMMENT '评估日期',
|
||||
`evaluator_id` bigint DEFAULT NULL COMMENT '评估人员ID',
|
||||
`evaluator_name` varchar(50) DEFAULT NULL COMMENT '评估人员姓名',
|
||||
`area_id` bigint DEFAULT NULL COMMENT '监区ID',
|
||||
`area_name` varchar(100) DEFAULT NULL COMMENT '监区名称',
|
||||
`total_score` decimal(10,2) DEFAULT 0.00 COMMENT '总分',
|
||||
`level` tinyint DEFAULT NULL COMMENT '评级:1-优秀 2-良好 3-一般 4-较差 5-危险',
|
||||
`risk_level` tinyint DEFAULT NULL COMMENT '风险等级:1-低风险 2-中风险 3-高风险 4-极高风险',
|
||||
`risk_score` decimal(10,2) DEFAULT 0.00 COMMENT '风险得分',
|
||||
`ai_status` tinyint DEFAULT 1 COMMENT 'AI生成状态:1-待生成 2-生成中 3-已完成 4-生成失败',
|
||||
`ai_content` text COMMENT 'AI生成内容',
|
||||
`ai_report_content` text COMMENT 'AI生成报告内容',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '报告状态:1-草稿 2-待审核 3-已审核 4-已作废',
|
||||
`auditor_id` bigint DEFAULT NULL COMMENT '审核人ID',
|
||||
`auditor_name` varchar(50) DEFAULT NULL COMMENT '审核人姓名',
|
||||
`audit_time` datetime DEFAULT NULL COMMENT '审核时间',
|
||||
`audit_opinion` varchar(500) DEFAULT NULL COMMENT '审核意见',
|
||||
`conclusion` text COMMENT '报告结论',
|
||||
`suggestions` text COMMENT '改造建议',
|
||||
`pdf_path` varchar(500) DEFAULT NULL COMMENT '报告PDF路径',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_report_no` (`report_no`, `tenant_id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_evaluation_date` (`evaluation_date`),
|
||||
KEY `idx_status` (`status`)
|
||||
) ENGINE=InnoDB COMMENT='评估报告表';
|
||||
|
||||
-- ============================================
|
||||
-- 17. 快速点评表 (prison_quick_comment)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_quick_comment`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_quick_comment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '点评ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(100) NOT NULL COMMENT '点评标题',
|
||||
`content` varchar(500) NOT NULL COMMENT '点评内容',
|
||||
`category_id` bigint DEFAULT NULL COMMENT '分类ID',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_category_id` (`category_id`)
|
||||
) ENGINE=InnoDB COMMENT='快速点评表';
|
||||
|
||||
-- ============================================
|
||||
-- 18. 快速点评分类表 (prison_comment_category)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_comment_category`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_comment_category` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '分类名称',
|
||||
`sort` int DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB COMMENT='快速点评分类表';
|
||||
|
||||
-- ============================================
|
||||
-- 19. 报告模板表 (prison_report_template)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_report_template`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_report_template` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '模板ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`name` varchar(100) NOT NULL COMMENT '模板名称',
|
||||
`type` tinyint NOT NULL COMMENT '模板类型:1-评估报告 2-月度报告 3-季度报告',
|
||||
`content` text COMMENT '模板内容(HTML或Markdown)',
|
||||
`fields` text COMMENT '字段配置JSON',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_type` (`type`)
|
||||
) ENGINE=InnoDB COMMENT='报告模板表';
|
||||
|
||||
-- ============================================
|
||||
-- 20. 报告表 (prison_report)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_report`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_report` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '报告ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`title` varchar(200) NOT NULL COMMENT '报告标题',
|
||||
`type` tinyint NOT NULL COMMENT '报告类型:1-日报告 2-周报告 3-月报告 4-季度报告 5-年度报告',
|
||||
`content` text COMMENT '报告内容',
|
||||
`prison_area_id` bigint DEFAULT NULL COMMENT '监区ID',
|
||||
`report_date` date DEFAULT NULL COMMENT '报告日期',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-草稿 2-已发布 3-已归档',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_type` (`type`),
|
||||
KEY `idx_report_date` (`report_date`)
|
||||
) ENGINE=InnoDB COMMENT='报告表';
|
||||
|
||||
-- ============================================
|
||||
-- 21. 释放登记信息表 (prison_release)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_release`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_release` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '释放ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`release_type` tinyint NOT NULL COMMENT '释放类型:1-刑满释放 2-假释 3-保外就医 4-减刑 5-暂予监外执行 6-特赦 7-死亡 8-其他',
|
||||
`release_date` date NOT NULL COMMENT '释放日期',
|
||||
`release_reason` varchar(500) DEFAULT NULL COMMENT '释放原因',
|
||||
`approve_no` varchar(50) DEFAULT NULL COMMENT '批准文号',
|
||||
`destination` varchar(200) DEFAULT NULL COMMENT '释放去向',
|
||||
`contact_phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
|
||||
`emergency_contact` varchar(100) DEFAULT NULL COMMENT '紧急联系人',
|
||||
`emergency_phone` varchar(20) DEFAULT NULL COMMENT '紧急联系人电话',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待释放 2-已释放 3-已取消',
|
||||
`remark` varchar(500) DEFAULT 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_release_date` (`release_date`)
|
||||
) ENGINE=InnoDB COMMENT='释放登记信息表';
|
||||
|
||||
-- ============================================
|
||||
-- 22. 风险评估维度表 (prison_risk)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_risk`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_risk` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '维度ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`name` varchar(50) NOT NULL COMMENT '维度名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '维度编码',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '维度描述',
|
||||
`weight` decimal(5,2) DEFAULT NULL COMMENT '权重',
|
||||
`max_score` decimal(10,2) DEFAULT 100.00 COMMENT '最高分值',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-启用 2-禁用',
|
||||
`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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`)
|
||||
) ENGINE=InnoDB COMMENT='风险评估维度表';
|
||||
|
||||
-- ============================================
|
||||
-- 23. 评估报告维度表 (prison_evaluation_dimension)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_evaluation_dimension`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_evaluation_dimension` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '维度ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`report_id` bigint NOT NULL COMMENT '报告ID',
|
||||
`dimension_name` varchar(100) NOT NULL COMMENT '维度名称',
|
||||
`dimension_code` varchar(50) DEFAULT NULL COMMENT '维度编码',
|
||||
`score` decimal(10,2) DEFAULT 0.00 COMMENT '得分',
|
||||
`max_score` decimal(10,2) DEFAULT 100.00 COMMENT '满分',
|
||||
`level` varchar(20) DEFAULT NULL COMMENT '评级',
|
||||
`description` text COMMENT '维度描述',
|
||||
`suggestion` text COMMENT '建议',
|
||||
`sort` int DEFAULT 0 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_report_id` (`report_id`)
|
||||
) ENGINE=InnoDB COMMENT='评估报告维度表';
|
||||
|
||||
-- ============================================
|
||||
-- 24. 评估报告维度数据表 (prison_evaluation_dimension_data)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_evaluation_dimension_data`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_evaluation_dimension_data` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '数据ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`dimension_id` bigint NOT NULL COMMENT '维度ID',
|
||||
`data_type` varchar(50) NOT NULL COMMENT '数据类型:score-得分 evidence-证据 behavior-行为',
|
||||
`content` text COMMENT '内容',
|
||||
`score` decimal(10,2) DEFAULT 0.00 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_dimension_id` (`dimension_id`)
|
||||
) ENGINE=InnoDB COMMENT='评估报告维度数据表';
|
||||
|
||||
-- ============================================
|
||||
-- 25. 报告评价表 (prison_report_comment)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_report_comment`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_report_comment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评价ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`report_id` bigint NOT NULL COMMENT '报告ID',
|
||||
`type` tinyint NOT NULL COMMENT '评价类型:1-总体评价 2-优点 3-不足 4-建议',
|
||||
`content` text NOT NULL COMMENT '评价内容',
|
||||
`score` decimal(10,2) DEFAULT NULL COMMENT '评价得分',
|
||||
`sort` int DEFAULT 0 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_report_id` (`report_id`)
|
||||
) ENGINE=InnoDB COMMENT='报告评价表';
|
||||
|
||||
-- ============================================
|
||||
-- 26. 消费明细表 (prison_consumption_detail)
|
||||
-- ============================================
|
||||
DROP TABLE IF EXISTS `prison_consumption_detail`;
|
||||
CREATE TABLE IF NOT EXISTS `prison_consumption_detail` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '明细ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`consumption_id` bigint NOT NULL COMMENT '消费ID',
|
||||
`goods_name` varchar(100) NOT NULL COMMENT '商品名称',
|
||||
`goods_code` varchar(50) DEFAULT NULL COMMENT '商品编码',
|
||||
`quantity` int DEFAULT 1 COMMENT '数量',
|
||||
`unit_price` decimal(10,2) NOT NULL COMMENT '单价',
|
||||
`total_price` decimal(10,2) 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 '是否删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_consumption_id` (`consumption_id`)
|
||||
) ENGINE=InnoDB COMMENT='消费明细表';
|
||||
|
||||
-- 恢复外键检查
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
-- ============================================
|
||||
-- 索引优化建议
|
||||
-- ============================================
|
||||
-- 为常用查询添加复合索引
|
||||
-- ALTER TABLE prison_prisoner ADD INDEX idx_area_cell (prison_area_id, prison_cell_id);
|
||||
-- ALTER TABLE prison_score ADD INDEX idx_prisoner_year_month (prisoner_id, year, month);
|
||||
-- ALTER TABLE prison_warning ADD INDEX idx_type_level_status (type, level, status);
|
||||
|
||||
-- ============================================
|
||||
-- 字段注释更新脚本(可选)
|
||||
-- ============================================
|
||||
-- COMMENT ON COLUMN prison_prisoner.children IS '子女情况';
|
||||
-- COMMENT ON COLUMN prison_questionnaire.cover_image IS '封面图片URL';
|
||||
-- COMMENT ON COLUMN prison_questionnaire.instruction IS '填写说明';
|
||||
-- COMMENT ON COLUMN prison_questionnaire.estimated_time IS '预计耗时(分钟)';
|
||||
-- COMMENT ON COLUMN prison_questionnaire.part_count IS '分区数量';
|
||||
-- COMMENT ON COLUMN prison_questionnaire.allow_anonymous IS '是否允许匿名:0-不允许 1-允许';
|
||||
@ -14,16 +14,13 @@
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>2025.12-jdk8-SNAPSHOT</revision>
|
||||
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
|
||||
<revision>2025.12-SNAPSHOT</revision>
|
||||
<flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
|
||||
<!-- 统一依赖管理 -->
|
||||
<spring.framework.version>5.3.39</spring.framework.version>
|
||||
<spring.security.version>5.8.16</spring.security.version>
|
||||
<spring.boot.version>2.7.18</spring.boot.version>
|
||||
<spring.boot.version>3.5.9</spring.boot.version>
|
||||
<!-- Web 相关 -->
|
||||
<springdoc.version>1.8.0</springdoc.version>
|
||||
<springdoc.version>2.8.14</springdoc.version>
|
||||
<knife4j.version>4.5.0</knife4j.version>
|
||||
<servlet.versoin>2.5</servlet.versoin>
|
||||
<!-- DB 相关 -->
|
||||
<druid.version>1.2.27</druid.version>
|
||||
<mybatis.version>3.5.19</mybatis.version>
|
||||
@ -41,30 +38,31 @@
|
||||
<!-- 服务保障相关 -->
|
||||
<lock4j.version>2.2.7</lock4j.version>
|
||||
<!-- 监控相关 -->
|
||||
<skywalking.version>8.12.0</skywalking.version>
|
||||
<spring-boot-admin.version>2.7.15</spring-boot-admin.version>
|
||||
<skywalking.version>9.5.0</skywalking.version>
|
||||
<spring-boot-admin.version>3.5.6</spring-boot-admin.version>
|
||||
<opentracing.version>0.33.0</opentracing.version>
|
||||
<!-- Test 测试相关 -->
|
||||
<podam.version>7.2.11.RELEASE</podam.version> <!-- Spring Boot 2.X 最多使用 7.2.11 版本 -->
|
||||
<podam.version>8.0.2.RELEASE</podam.version>
|
||||
<jedis-mock.version>1.1.12</jedis-mock.version>
|
||||
<mockito-inline.version>4.11.0</mockito-inline.version>
|
||||
<mockito-inline.version>5.2.0</mockito-inline.version>
|
||||
<!-- Bpm 工作流相关 -->
|
||||
<flowable.version>6.8.0</flowable.version>
|
||||
<flowable.version>7.2.0</flowable.version>
|
||||
<!-- 工具类相关 -->
|
||||
<anji-plus-captcha.version>1.4.0</anji-plus-captcha.version>
|
||||
<jsoup.version>1.21.2</jsoup.version>
|
||||
<lombok.version>1.18.42</lombok.version>
|
||||
<mapstruct.version>1.6.3</mapstruct.version>
|
||||
<hutool-5.version>5.8.42</hutool-5.version>
|
||||
<hutool-6.version>6.0.0-M22</hutool-6.version>
|
||||
<fastexcel.version>1.3.0</fastexcel.version>
|
||||
<velocity.version>2.4</velocity.version> <!-- JDK8 不能从 2.4 升级到 2.4.1,会报包不存在!!!! -->
|
||||
<velocity.version>2.4.1</velocity.version>
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<guava.version>33.5.0-jre</guava.version>
|
||||
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
|
||||
<commons-net.version>3.12.0</commons-net.version>
|
||||
<commons-lang3.version>3.20.0</commons-lang3.version>
|
||||
<jsch.version>2.27.7</jsch.version>
|
||||
<tika-core.version>2.9.3</tika-core.version> <!-- JDK8 不能从 2.9.3 升级到 3.X,会报 JDK8 不支持 -->
|
||||
<tika-core.version>3.2.3</tika-core.version>
|
||||
<ip2region.version>2.7.0</ip2region.version>
|
||||
<bizlog-sdk.version>3.0.6</bizlog-sdk.version>
|
||||
<netty.version>4.2.9.Final</netty.version>
|
||||
@ -78,8 +76,6 @@
|
||||
<jimubi.version>2.3.0</jimubi.version>
|
||||
<weixin-java.version>4.7.9-20251224.161447</weixin-java.version>
|
||||
<alipay-sdk-java.version>4.40.607.ALL</alipay-sdk-java.version>
|
||||
<!-- 专属于 JDK8 安全漏洞升级 -->
|
||||
<logback.version>1.2.13</logback.version> <!-- 无法使用 1.3.X 版本,启动会报错 -->
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -92,20 +88,6 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId> <!-- JDK8 版本独有:保证 Spring Framework 尽量高 -->
|
||||
<version>${spring.framework.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-bom</artifactId> <!-- JDK8 版本独有:保证 Spring Security 尽量高 -->
|
||||
<version>${spring.security.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
@ -171,12 +153,18 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
|
||||
@ -189,7 +177,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -200,12 +188,12 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-jsqlparser-4.9</artifactId>
|
||||
<artifactId>mybatis-plus-jsqlparser</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -215,7 +203,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 -->
|
||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId> <!-- 多数据源 -->
|
||||
<version>${dynamic-datasource.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -265,18 +253,8 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.redisson</groupId>
|
||||
<!-- 使用 redisson-spring-data-27 替代,解决 Tuple NoClassDefFoundError 报错 -->
|
||||
<artifactId>redisson-spring-data-35</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-data-27</artifactId>
|
||||
<version>${redisson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
@ -492,6 +470,11 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool-5.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara.hutool</groupId>
|
||||
<artifactId>hutool-extra</artifactId>
|
||||
<version>${hutool-6.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.idev.excel</groupId>
|
||||
@ -620,12 +603,12 @@
|
||||
<!-- 积木报表-->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.jimureport</groupId>
|
||||
<artifactId>jimureport-spring-boot-starter</artifactId>
|
||||
<artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
|
||||
<version>${jimureport.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.jimureport</groupId>
|
||||
<artifactId>jimubi-spring-boot-starter</artifactId>
|
||||
<artifactId>jimubi-spring-boot3-starter</artifactId>
|
||||
<version>${jimubi.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -662,18 +645,6 @@
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>${mqtt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 专属于 JDK8 安全漏洞升级 -->
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>${logback.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<scope>provided</scope> <!-- 设置为 provided,主要是 PageParam 使用到 -->
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
package cn.iocoder.yudao.framework.common.biz.infra.logger;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiAccessLogCreateReqDTO;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* API 访问日志的 API 接口
|
||||
*
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package cn.iocoder.yudao.framework.common.biz.infra.logger;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
/**
|
||||
* API 错误日志的 API 接口
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package cn.iocoder.yudao.framework.common.biz.infra.logger.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
||||
@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.common.biz.infra.logger.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
package cn.iocoder.yudao.framework.common.biz.system.logger;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.biz.system.logger.dto.OperateLogCreateReqDTO;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 操作日志 API 接口
|
||||
*
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
package cn.iocoder.yudao.framework.common.biz.system.logger.dto;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 系统操作日志 Create Request DTO
|
||||
*
|
||||
|
||||
@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessToken
|
||||
import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.biz.system.oauth2.dto.OAuth2AccessTokenRespDTO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* OAuth2.0 Token API 接口
|
||||
|
||||
@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@ package cn.iocoder.yudao.framework.common.pojo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Schema(description="分页参数")
|
||||
|
||||
@ -7,12 +7,11 @@ import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import lombok.SneakyThrows;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.util.UriComponents;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URI;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
@ -33,9 +32,8 @@ public class HttpUtils {
|
||||
* @param value 参数
|
||||
* @return 编码后的参数
|
||||
*/
|
||||
@SneakyThrows
|
||||
public static String encodeUtf8(String value) {
|
||||
return URLEncoder.encode(value, StandardCharsets.UTF_8.name());
|
||||
return URLEncoder.encode(value, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,9 +42,8 @@ public class HttpUtils {
|
||||
* @param value 参数
|
||||
* @return 解码后的参数
|
||||
*/
|
||||
@SneakyThrows
|
||||
public static String decodeUtf8(String value) {
|
||||
return URLDecoder.decode(value, StandardCharsets.UTF_8.name());
|
||||
return URLDecoder.decode(value, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@ -1,19 +1,16 @@
|
||||
package cn.iocoder.yudao.framework.common.util.servlet;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.hutool.extra.servlet.JakartaServletUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -32,22 +29,7 @@ public class ServletUtils {
|
||||
@SuppressWarnings("deprecation") // 必须使用 APPLICATION_JSON_UTF8_VALUE,否则会乱码
|
||||
public static void writeJSON(HttpServletResponse response, Object object) {
|
||||
String content = JsonUtils.toJsonString(object);
|
||||
ServletUtil.write(response, content, MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回附件
|
||||
*
|
||||
* @param response 响应
|
||||
* @param filename 文件名
|
||||
* @param content 附件内容
|
||||
*/
|
||||
public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException {
|
||||
// 设置 header 和 contentType
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
// 输出附件
|
||||
IoUtil.write(response.getOutputStream(), false, content);
|
||||
JakartaServletUtil.write(response, content, MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,7 +67,7 @@ public class ServletUtils {
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
return ServletUtil.getClientIP(request);
|
||||
return JakartaServletUtil.getClientIP(request);
|
||||
}
|
||||
|
||||
public static boolean isJsonRequest(ServletRequest request) {
|
||||
@ -95,7 +77,7 @@ public class ServletUtils {
|
||||
public static String getBody(HttpServletRequest request) {
|
||||
// 只有在 json 请求在读取,因为只有 CacheRequestBodyFilter 才会进行缓存,支持重复读取
|
||||
if (isJsonRequest(request)) {
|
||||
return ServletUtil.getBody(request);
|
||||
return JakartaServletUtil.getBody(request);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -103,21 +85,21 @@ public class ServletUtils {
|
||||
public static byte[] getBodyBytes(HttpServletRequest request) {
|
||||
// 只有在 json 请求在读取,因为只有 CacheRequestBodyFilter 才会进行缓存,支持重复读取
|
||||
if (isJsonRequest(request)) {
|
||||
return ServletUtil.getBodyBytes(request);
|
||||
return JakartaServletUtil.getBodyBytes(request);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getClientIP(HttpServletRequest request) {
|
||||
return ServletUtil.getClientIP(request);
|
||||
return JakartaServletUtil.getClientIP(request);
|
||||
}
|
||||
|
||||
public static Map<String, String> getParamMap(HttpServletRequest request) {
|
||||
return ServletUtil.getParamMap(request);
|
||||
return JakartaServletUtil.getParamMap(request);
|
||||
}
|
||||
|
||||
public static Map<String, String> getHeaderMap(HttpServletRequest request) {
|
||||
return ServletUtil.getHeaderMap(request);
|
||||
return JakartaServletUtil.getHeaderMap(request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,10 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.Validation;
|
||||
import javax.validation.Validator;
|
||||
import jakarta.validation.ConstraintViolation;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
import jakarta.validation.Validation;
|
||||
import jakarta.validation.Validator;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({
|
||||
|
||||
@ -2,9 +2,9 @@ package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({
|
||||
|
||||
@ -3,8 +3,8 @@ package cn.iocoder.yudao.framework.common.validation;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
public class MobileValidator implements ConstraintValidator<Mobile, String> {
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({
|
||||
|
||||
@ -3,8 +3,8 @@ package cn.iocoder.yudao.framework.common.validation;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
public class TelephoneValidator implements ConstraintValidator<Telephone, String> {
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -22,6 +22,7 @@ import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@ -43,11 +44,7 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
import org.springframework.web.util.pattern.PathPattern;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
|
||||
@ -12,13 +12,13 @@ import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService;
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import cn.iocoder.yudao.framework.web.core.filter.ApiRequestFilter;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -8,13 +8,12 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.config.TenantProperties;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -16,6 +16,11 @@
|
||||
|
||||
package org.springframework.messaging.handler.invocation;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Arrays;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
@ -27,11 +32,6 @@ import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.handler.HandlerMethod;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID;
|
||||
|
||||
/**
|
||||
@ -50,10 +50,12 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
|
||||
private static final Object[] EMPTY_ARGS = new Object[0];
|
||||
|
||||
|
||||
private HandlerMethodArgumentResolverComposite resolvers = new HandlerMethodArgumentResolverComposite();
|
||||
|
||||
private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance from a {@code HandlerMethod}.
|
||||
*/
|
||||
@ -81,6 +83,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
super(bean, methodName, parameterTypes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} to use for resolving method argument values.
|
||||
*/
|
||||
@ -91,12 +94,13 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
/**
|
||||
* Set the ParameterNameDiscoverer for resolving parameter names when needed
|
||||
* (e.g. default request attribute name).
|
||||
* <p>Default is a {@link DefaultParameterNameDiscoverer}.
|
||||
* <p>Default is a {@link org.springframework.core.DefaultParameterNameDiscoverer}.
|
||||
*/
|
||||
public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
this.parameterNameDiscoverer = parameterNameDiscoverer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Invoke the method after resolving its argument values in the context of the given message.
|
||||
* <p>Argument values are commonly resolved through
|
||||
@ -200,20 +204,21 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
assertTargetBean(getBridgedMethod(), getBean(), args);
|
||||
String text = (ex.getMessage() != null ? ex.getMessage() : "Illegal argument");
|
||||
String text = (ex.getMessage() == null || ex.getCause() instanceof NullPointerException) ?
|
||||
"Illegal argument": ex.getMessage();
|
||||
throw new IllegalStateException(formatInvokeError(text, args), ex);
|
||||
}
|
||||
catch (InvocationTargetException ex) {
|
||||
// Unwrap for HandlerExceptionResolvers ...
|
||||
Throwable targetException = ex.getTargetException();
|
||||
if (targetException instanceof RuntimeException) {
|
||||
throw (RuntimeException) targetException;
|
||||
if (targetException instanceof RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
else if (targetException instanceof Error) {
|
||||
throw (Error) targetException;
|
||||
else if (targetException instanceof Error error) {
|
||||
throw error;
|
||||
}
|
||||
else if (targetException instanceof Exception) {
|
||||
throw (Exception) targetException;
|
||||
else if (targetException instanceof Exception exception) {
|
||||
throw exception;
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException(formatInvokeError("Invocation failure", args), targetException);
|
||||
@ -225,7 +230,8 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
return new AsyncResultMethodParameter(returnValue);
|
||||
}
|
||||
|
||||
private class AsyncResultMethodParameter extends HandlerMethodParameter {
|
||||
|
||||
private class AsyncResultMethodParameter extends AnnotatedMethodParameter {
|
||||
|
||||
@Nullable
|
||||
private final Object returnValue;
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package cn.iocoder.yudao.framework.dict.validation;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({
|
||||
ElementType.METHOD,
|
||||
|
||||
@ -2,9 +2,9 @@ package cn.iocoder.yudao.framework.dict.validation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -2,9 +2,9 @@ package cn.iocoder.yudao.framework.dict.validation;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.List;
|
||||
|
||||
public class InDictValidator implements ConstraintValidator<InDict, Object> {
|
||||
|
||||
@ -5,9 +5,9 @@ import cn.idev.excel.converters.longconverter.LongStringConverter;
|
||||
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.handler.ColumnWidthMatchStyleStrategy;
|
||||
import cn.iocoder.yudao.framework.excel.core.handler.SelectSheetWriteHandler;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
@ -13,7 +13,7 @@ import org.quartz.PersistJobDataAfterExecution;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import jakarta.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage;
|
||||
|
||||
@ -2,10 +2,11 @@ package cn.iocoder.yudao.framework.quartz.core.scheduler;
|
||||
|
||||
import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker;
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import org.quartz.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
|
||||
/**
|
||||
* {@link org.quartz.Scheduler} 的管理器,负责创建任务
|
||||
@ -142,7 +143,7 @@ public class SchedulerManager {
|
||||
|
||||
private void validateScheduler() {
|
||||
if (scheduler == null) {
|
||||
throw exception0(NOT_IMPLEMENTED.getCode(),
|
||||
throw new ServiceException(NOT_IMPLEMENTED.getCode(),
|
||||
"[定时任务 - 已禁用][参考 https://doc.iocoder.cn/job/ 开启]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.quartz.core.service;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
||||
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/TracerProperties.java
Normal file → Executable file
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/TracerProperties.java
Normal file → Executable file
@ -18,7 +18,7 @@ import org.springframework.context.annotation.Bean;
|
||||
@ConditionalOnClass(name = {
|
||||
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer", // 来自 apm-toolkit-opentracing.jar
|
||||
// "io.opentracing.Tracer", // 来自 opentracing-api.jar
|
||||
"javax.servlet.Filter"
|
||||
"jakarta.servlet.Filter"
|
||||
})
|
||||
@EnableConfigurationProperties(TracerProperties.class)
|
||||
@ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true)
|
||||
|
||||
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java
Normal file → Executable file
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/annotation/BizTrace.java
Normal file → Executable file
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java
Normal file → Executable file
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java
Normal file → Executable file
8
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/filter/TraceFilter.java
Normal file → Executable file
8
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/filter/TraceFilter.java
Normal file → Executable file
@ -3,10 +3,10 @@ package cn.iocoder.yudao.framework.tracer.core.filter;
|
||||
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/package-info.java
Normal file → Executable file
0
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/package-info.java
Normal file → Executable file
@ -71,19 +71,25 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-jsqlparser-4.9</artifactId>
|
||||
<artifactId>mybatis-plus-jsqlparser</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 -->
|
||||
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId> <!-- 多数据源 -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.datasource.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.datasource.core.filter.DruidAdRemoveFilter;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
import com.alibaba.druid.spring.boot3.autoconfigure.properties.DruidStatProperties;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
|
||||
@ -3,10 +3,10 @@ package cn.iocoder.yudao.framework.datasource.core.filter;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -54,14 +54,14 @@ public class MyBatisUtils {
|
||||
if (CollUtil.isEmpty(sortingFields)) {
|
||||
return;
|
||||
}
|
||||
if (wrapper instanceof QueryWrapper) {
|
||||
if (wrapper instanceof QueryWrapper<T>) {
|
||||
QueryWrapper<T> query = (QueryWrapper<T>) wrapper;
|
||||
for (SortingField sortingField : sortingFields) {
|
||||
query.orderBy(true,
|
||||
SortingField.ORDER_ASC.equals(sortingField.getOrder()),
|
||||
StrUtil.toUnderlineCase(sortingField.getField()));
|
||||
}
|
||||
} else if (wrapper instanceof LambdaQueryWrapper) {
|
||||
} else if (wrapper instanceof LambdaQueryWrapper<T>) {
|
||||
// LambdaQueryWrapper 不直接支持字符串字段排序,使用 last 方法拼接 ORDER BY
|
||||
LambdaQueryWrapper<T> lambdaQuery = (LambdaQueryWrapper<T>) wrapper;
|
||||
StringBuilder orderBy = new StringBuilder();
|
||||
|
||||
@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.ExpressionParser;
|
||||
@ -21,7 +21,8 @@ import java.lang.reflect.Method;
|
||||
*/
|
||||
public class ExpressionIdempotentKeyResolver implements IdempotentKeyResolver {
|
||||
|
||||
private final ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
|
||||
private final ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
|
||||
|
||||
private final ExpressionParser expressionParser = new SpelExpressionParser();
|
||||
|
||||
@Override
|
||||
|
||||
@ -11,13 +11,13 @@ import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstant
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.signature.core.annotation.ApiSignature;
|
||||
import cn.iocoder.yudao.framework.signature.core.redis.ApiSignatureRedisDAO;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.SortedMap;
|
||||
|
||||
@ -26,10 +26,6 @@
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-data-27</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.redis.config;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.redisson.spring.starter.RedissonAutoConfiguration;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationV2;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
@ -13,7 +13,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
/**
|
||||
* Redis 配置类
|
||||
*/
|
||||
@AutoConfiguration(before = RedissonAutoConfiguration.class) // 目的:使用自己定义的 RedisTemplate Bean
|
||||
@AutoConfiguration(before = RedissonAutoConfigurationV2.class) // 目的:使用自己定义的 RedisTemplate Bean
|
||||
public class YudaoRedisAutoConfiguration {
|
||||
|
||||
/**
|
||||
|
||||
@ -8,10 +8,10 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.mzt.logapi.beans.LogRecord;
|
||||
import com.mzt.logapi.service.ILogRecordService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 自定义的 URL 的安全配置
|
||||
* 目的:每个 Maven Module 可以自定义规则!
|
||||
|
||||
@ -4,8 +4,8 @@ import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import cn.iocoder.yudao.framework.security.core.handler.AuthenticationEntryPoint
|
||||
import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkService;
|
||||
import cn.iocoder.yudao.framework.security.core.service.SecurityFrameworkServiceImpl;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import javax.annotation.Resource;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.config.MethodInvokingFactoryBean;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
|
||||
@ -5,6 +5,9 @@ import cn.iocoder.yudao.framework.security.core.filter.TokenAuthenticationFilter
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@ -28,9 +31,6 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
import org.springframework.web.util.pattern.PathPattern;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.DispatcherType;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -12,14 +12,14 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -8,16 +8,14 @@ import lombok.extern.slf4j.Slf4j;
|
||||
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 jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.FORBIDDEN;
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
|
||||
|
||||
/**
|
||||
* 访问一个需要认证的 URL 资源,已经认证(登录)但是没有权限的情况下,返回 {@link GlobalErrorCodeConstants#FORBIDDEN} 错误码。
|
||||
|
||||
@ -8,9 +8,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
import org.springframework.security.web.access.ExceptionTranslationFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ 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 jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
|
||||
@ -40,11 +40,11 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiAccessLogCommonApi;
|
||||
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration;
|
||||
import javax.servlet.Filter;
|
||||
import jakarta.servlet.Filter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
@ -22,14 +22,14 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@ -162,8 +162,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
|
||||
// ========== 解析 @ApiAccessLog、@Swagger 注解 ==========
|
||||
|
||||
private static OperateTypeEnum parseOperateLogType(HttpServletRequest request) {
|
||||
RequestMethod requestMethod = ArrayUtil.firstMatch(method ->
|
||||
StrUtil.equalsAnyIgnoreCase(method.name(), request.getMethod()), RequestMethod.values());
|
||||
RequestMethod requestMethod = RequestMethod.resolve(request.getMethod());
|
||||
if (requestMethod == null) {
|
||||
return OperateTypeEnum.OTHER;
|
||||
}
|
||||
@ -238,7 +237,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
|
||||
return;
|
||||
}
|
||||
// 情况三:Object,遍历处理
|
||||
Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
|
||||
Iterator<Map.Entry<String, JsonNode>> iterator = node.properties().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, JsonNode> entry = iterator.next();
|
||||
if (ArrayUtil.contains(sanitizeKeys, entry.getKey())
|
||||
|
||||
@ -6,13 +6,13 @@ import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.spring.SpringUtils;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StopWatch;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.framework.desensitize.core.slider.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils;
|
||||
import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler;
|
||||
|
||||
@ -48,7 +47,7 @@ public abstract class AbstractSliderDesensitizationHandler<T extends Annotation>
|
||||
* @return 构建后的替换符
|
||||
*/
|
||||
private String buildReplacerByLength(String replacer, int length) {
|
||||
return StrUtil.repeat(replacer, length);
|
||||
return replacer.repeat(length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package cn.iocoder.yudao.framework.encrypt.config;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* HTTP API 加解密配置
|
||||
*
|
||||
|
||||
@ -5,11 +5,11 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.asymmetric.AsymmetricDecryptor;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
import cn.hutool.crypto.symmetric.SymmetricDecryptor;
|
||||
import jakarta.servlet.ReadListener;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -14,6 +14,10 @@ import cn.iocoder.yudao.framework.encrypt.core.annotation.ApiEncrypt;
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import cn.iocoder.yudao.framework.web.core.filter.ApiRequestFilter;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
@ -21,10 +25,6 @@ import org.springframework.web.servlet.HandlerExecutionChain;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
import org.springframework.web.util.ServletRequestPathUtils;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.invalidParamException;
|
||||
|
||||
@ -4,11 +4,11 @@ import cn.hutool.crypto.asymmetric.AsymmetricEncryptor;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
import cn.hutool.crypto.symmetric.SymmetricEncryptor;
|
||||
import cn.iocoder.yudao.framework.encrypt.config.ApiEncryptProperties;
|
||||
import jakarta.servlet.ServletOutputStream;
|
||||
import jakarta.servlet.WriteListener;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponseWrapper;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.WriteListener;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponseWrapper;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
@ -10,8 +10,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springdoc.core.SpringDocConfigProperties;
|
||||
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||
import org.springdoc.core.properties.SpringDocConfigProperties;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.swagger.config;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* Swagger 配置属性
|
||||
|
||||
@ -11,11 +11,15 @@ import io.swagger.v3.oas.models.media.StringSchema;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import org.springdoc.core.*;
|
||||
import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
|
||||
import org.springdoc.core.customizers.OperationCustomizer;
|
||||
import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springdoc.core.properties.SpringDocConfigProperties;
|
||||
import org.springdoc.core.providers.JavadocProvider;
|
||||
import org.springdoc.core.service.OpenAPIService;
|
||||
import org.springdoc.core.service.SecurityService;
|
||||
import org.springdoc.core.utils.PropertyResolverUtils;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
@ -7,9 +7,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@ConfigurationProperties(prefix = "yudao.web")
|
||||
@Validated
|
||||
|
||||
@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
import jakarta.servlet.Filter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@ -28,7 +29,6 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 过滤 /admin-api、/app-api 等 API 请求的过滤器
|
||||
|
||||
@ -4,10 +4,10 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
package cn.iocoder.yudao.framework.web.core.filter;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import jakarta.servlet.ReadListener;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.DEMO_DENY;
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@ import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
||||
import com.google.common.util.concurrent.UncheckedExecutionException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.ConstraintViolation;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
import jakarta.validation.ValidationException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
@ -34,11 +38,8 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||
import org.springframework.web.servlet.resource.NoResourceFoundException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.ValidationException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -99,6 +100,9 @@ public class GlobalExceptionHandler {
|
||||
if (ex instanceof NoHandlerFoundException) {
|
||||
return noHandlerFoundExceptionHandler((NoHandlerFoundException) ex);
|
||||
}
|
||||
if (ex instanceof NoResourceFoundException) {
|
||||
return noResourceFoundExceptionHandler(request, (NoResourceFoundException) ex);
|
||||
}
|
||||
if (ex instanceof HttpRequestMethodNotSupportedException) {
|
||||
return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex);
|
||||
}
|
||||
@ -232,6 +236,15 @@ public class GlobalExceptionHandler {
|
||||
return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getRequestURL()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 SpringMVC 请求地址不存在
|
||||
*/
|
||||
@ExceptionHandler(NoResourceFoundException.class)
|
||||
private CommonResult<?> noResourceFoundExceptionHandler(HttpServletRequest req, NoResourceFoundException ex) {
|
||||
log.warn("[noResourceFoundExceptionHandler]", ex);
|
||||
return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getResourcePath()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 SpringMVC 请求方法不正确
|
||||
*
|
||||
|
||||
@ -5,13 +5,12 @@ import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 专属于 web 包的工具类
|
||||
*
|
||||
|
||||
@ -6,10 +6,10 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.util.PathMatcher;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -2,8 +2,8 @@ package cn.iocoder.yudao.framework.xss.core.filter;
|
||||
|
||||
import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@ -7,11 +7,11 @@ import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.deser.std.StringDeserializer;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.PathMatcher;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
||||
@ -4,8 +4,8 @@ import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* WebSocket 配置项
|
||||
|
||||
@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.websocket.config.WebSocketProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
|
||||
/**
|
||||
* WebSocket 的权限自定义
|
||||
|
||||
@ -65,6 +65,8 @@
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
||||
@ -2,11 +2,10 @@ package cn.iocoder.yudao.module.infra.api.config;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.service.config.ConfigService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 参数配置 API 实现类
|
||||
*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.infra.api.file;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 文件 API 接口
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user