feat(prison): 问卷系统批量更新接口及性能优化
- 添加问卷问题批量更新API: POST /prison/question/batch-update - 修复savePartitions循环调用API问题 (50题只需1次请求) - 修复onPartitionDragEnd拖拽排序性能问题 - 修复onQuestionDragEnd问题拖拽排序性能问题 - 添加QuestionBatchUpdateReqVO请求对象 - 添加自动填充来源字典SQL (35个选项)
This commit is contained in:
parent
bf6875adf6
commit
8077990e5d
3
.gitignore
vendored
3
.gitignore
vendored
@ -52,3 +52,6 @@ application-my.yaml
|
||||
|
||||
/yudao-ui-app/unpackage/
|
||||
**/.DS_Store
|
||||
|
||||
# Generated codegen files
|
||||
/codegen/
|
||||
|
||||
1
pom.xml
1
pom.xml
@ -25,6 +25,7 @@
|
||||
<!-- <module>yudao-module-erp</module>-->
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
<!-- <module>yudao-module-iot</module>-->
|
||||
<module>yudao-module-prison</module>
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
151
sql/prison_dict_data.sql
Normal file
151
sql/prison_dict_data.sql
Normal file
@ -0,0 +1,151 @@
|
||||
-- ============================================
|
||||
-- 监狱管理模块字典数据
|
||||
-- ============================================
|
||||
|
||||
-- 1. 监管等级 (prison_supervision_level)
|
||||
INSERT 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 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 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 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 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 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 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 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 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 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);
|
||||
|
||||
-- 6. 问卷状态 (prison_questionnaire_status)
|
||||
INSERT 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 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 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 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 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 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);
|
||||
|
||||
-- 8. 消费状态 (prison_consumption_status)
|
||||
INSERT 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 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 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 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);
|
||||
|
||||
-- 10. 考核等级 (prison_score_level)
|
||||
INSERT 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 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 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 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 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 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);
|
||||
|
||||
-- 13. 监室状态 (prison_cell_status)
|
||||
INSERT 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 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);
|
||||
228
sql/prison_init.sql
Normal file
228
sql/prison_init.sql
Normal file
@ -0,0 +1,228 @@
|
||||
-- ============================================
|
||||
-- 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 '刑期(月)',
|
||||
`imprisonment_date` date DEFAULT NULL COMMENT '入狱日期',
|
||||
`release_date` date DEFAULT NULL COMMENT '释放日期',
|
||||
`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',
|
||||
`prison_cell_id` bigint DEFAULT NULL COMMENT '监室ID',
|
||||
`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='问卷答题记录表';
|
||||
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);
|
||||
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;
|
||||
77
yudao-module-prison/pom.xml
Normal file
77
yudao-module-prison/pom.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-module-prison</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>yudao-module-prison</name>
|
||||
<description>监狱管理模块:罪犯信息、监区管理、计分考核、危险评估等</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 引入芋道框架 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 引入 system 模块 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 引入 infra 模块 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-infra</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.area;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.area.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.area.AreaDO;
|
||||
import cn.iocoder.yudao.module.prison.service.area.AreaService;
|
||||
|
||||
@Tag(name = "管理后台 - 监区信息")
|
||||
@RestController
|
||||
@RequestMapping("/prison/area")
|
||||
@Validated
|
||||
public class PrisonAreaController {
|
||||
|
||||
@Resource
|
||||
private AreaService areaService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建监区信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:create')")
|
||||
public CommonResult<Long> createArea(@Valid @RequestBody AreaSaveReqVO createReqVO) {
|
||||
return success(areaService.createArea(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新监区信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:update')")
|
||||
public CommonResult<Boolean> updateArea(@Valid @RequestBody AreaSaveReqVO updateReqVO) {
|
||||
areaService.updateArea(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除监区信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:delete')")
|
||||
public CommonResult<Boolean> deleteArea(@RequestParam("id") Long id) {
|
||||
areaService.deleteArea(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除监区信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:delete')")
|
||||
public CommonResult<Boolean> deleteAreaList(@RequestParam("ids") List<Long> ids) {
|
||||
areaService.deleteAreaListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得监区信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:query')")
|
||||
public CommonResult<AreaRespVO> getArea(@RequestParam("id") Long id) {
|
||||
AreaDO area = areaService.getArea(id);
|
||||
return success(BeanUtils.toBean(area, AreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得监区信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:query')")
|
||||
public CommonResult<PageResult<AreaRespVO>> getAreaPage(@Valid AreaPageReqVO pageReqVO) {
|
||||
PageResult<AreaDO> pageResult = areaService.getAreaPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出监区信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:area:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAreaExcel(@Valid AreaPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AreaDO> list = areaService.getAreaPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "监区信息.xls", "数据", AreaRespVO.class,
|
||||
BeanUtils.toBean(list, AreaRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.area.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 监区信息分页 Request VO")
|
||||
@Data
|
||||
public class AreaPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "监区名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监区编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "容纳人数")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "26596")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.area.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监区信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AreaRespVO {
|
||||
|
||||
@Schema(description = "监区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("监区ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "监区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("监区名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("监区编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室", example = "1")
|
||||
@ExcelProperty("监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "容纳人数")
|
||||
@ExcelProperty("容纳人数")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "26596")
|
||||
@ExcelProperty("当前人数")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态:1-启用 2-禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.area.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监区信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class AreaSaveReqVO {
|
||||
|
||||
@Schema(description = "监区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "监区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "监区名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "监区编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "容纳人数")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "26596")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态:1-启用 2-禁用不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.cell;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.cell.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.cell.CellDO;
|
||||
import cn.iocoder.yudao.module.prison.service.cell.CellService;
|
||||
|
||||
@Tag(name = "管理后台 - 监室信息")
|
||||
@RestController
|
||||
@RequestMapping("/prison/cell")
|
||||
@Validated
|
||||
public class PrisonCellController {
|
||||
|
||||
@Resource
|
||||
private CellService cellService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建监室信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:create')")
|
||||
public CommonResult<Long> createCell(@Valid @RequestBody CellSaveReqVO createReqVO) {
|
||||
return success(cellService.createCell(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新监室信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:update')")
|
||||
public CommonResult<Boolean> updateCell(@Valid @RequestBody CellSaveReqVO updateReqVO) {
|
||||
cellService.updateCell(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除监室信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:delete')")
|
||||
public CommonResult<Boolean> deleteCell(@RequestParam("id") Long id) {
|
||||
cellService.deleteCell(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除监室信息")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:delete')")
|
||||
public CommonResult<Boolean> deleteCellList(@RequestParam("ids") List<Long> ids) {
|
||||
cellService.deleteCellListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得监室信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:query')")
|
||||
public CommonResult<CellRespVO> getCell(@RequestParam("id") Long id) {
|
||||
CellDO cell = cellService.getCell(id);
|
||||
return success(BeanUtils.toBean(cell, CellRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得监室信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:query')")
|
||||
public CommonResult<PageResult<CellRespVO>> getCellPage(@Valid CellPageReqVO pageReqVO) {
|
||||
PageResult<CellDO> pageResult = cellService.getCellPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CellRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出监室信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCellExcel(@Valid CellPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CellDO> list = cellService.getCellPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "监室信息.xls", "数据", CellRespVO.class,
|
||||
BeanUtils.toBean(list, CellRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.cell.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 监室信息分页 Request VO")
|
||||
@Data
|
||||
public class CellPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "所属监区ID", example = "9889")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监室名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监室编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "床位数量")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "31423")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.cell.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监室信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CellRespVO {
|
||||
|
||||
@Schema(description = "监室ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4727")
|
||||
@ExcelProperty("监室ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属监区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9889")
|
||||
@ExcelProperty("所属监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监室名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("监室名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监室编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("监室编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "床位数量")
|
||||
@ExcelProperty("床位数量")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "31423")
|
||||
@ExcelProperty("当前人数")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-启用 2-禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.cell.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监室信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class CellSaveReqVO {
|
||||
|
||||
@Schema(description = "监室ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4727")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属监区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9889")
|
||||
@NotNull(message = "所属监区ID不能为空")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监室名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "监室名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "监室编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "监室编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "床位数量")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "当前人数", example = "31423")
|
||||
private Integer currentCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-启用 2-禁用不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.consumption.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDO;
|
||||
import cn.iocoder.yudao.module.prison.service.consumption.ConsumptionService;
|
||||
|
||||
@Tag(name = "管理后台 - 消费记录")
|
||||
@RestController
|
||||
@RequestMapping("/prison/consumption")
|
||||
@Validated
|
||||
public class PrisonConsumptionController {
|
||||
|
||||
@Resource
|
||||
private ConsumptionService consumptionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建消费记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:create')")
|
||||
public CommonResult<Long> createConsumption(@Valid @RequestBody ConsumptionSaveReqVO createReqVO) {
|
||||
return success(consumptionService.createConsumption(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新消费记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:update')")
|
||||
public CommonResult<Boolean> updateConsumption(@Valid @RequestBody ConsumptionSaveReqVO updateReqVO) {
|
||||
consumptionService.updateConsumption(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除消费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:delete')")
|
||||
public CommonResult<Boolean> deleteConsumption(@RequestParam("id") Long id) {
|
||||
consumptionService.deleteConsumption(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除消费记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:delete')")
|
||||
public CommonResult<Boolean> deleteConsumptionList(@RequestParam("ids") List<Long> ids) {
|
||||
consumptionService.deleteConsumptionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得消费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:query')")
|
||||
public CommonResult<ConsumptionRespVO> getConsumption(@RequestParam("id") Long id) {
|
||||
ConsumptionDO consumption = consumptionService.getConsumption(id);
|
||||
return success(BeanUtils.toBean(consumption, ConsumptionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得消费记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:query')")
|
||||
public CommonResult<PageResult<ConsumptionRespVO>> getConsumptionPage(@Valid ConsumptionPageReqVO pageReqVO) {
|
||||
PageResult<ConsumptionDO> pageResult = consumptionService.getConsumptionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConsumptionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出消费记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConsumptionExcel(@Valid ConsumptionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ConsumptionDO> list = consumptionService.getConsumptionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "消费记录.xls", "数据", ConsumptionRespVO.class,
|
||||
BeanUtils.toBean(list, ConsumptionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录分页 Request VO")
|
||||
@Data
|
||||
public class ConsumptionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "罪犯ID", example = "25932")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "交易时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConsumptionRespVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
@ExcelProperty("记录ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25932")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("类型:1-存款 2-消费 3-转账")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
@ExcelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
@ExcelProperty("商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
@ExcelProperty("商品数量")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@ExcelProperty("订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "交易时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("交易时间")
|
||||
private LocalDateTime tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-成功 2-失败")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConsumptionSaveReqVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25932")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "类型:1-存款 2-消费 3-转账不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "交易时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "交易时间不能为空")
|
||||
private LocalDateTime tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-成功 2-失败不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.convert.prisoner.PrisonerConvert;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO;
|
||||
import cn.iocoder.yudao.module.prison.service.PrisonerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 服刑人员信息管理 Controller
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Tag(name = "管理后台 - 服刑人员信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/prison/prisoner")
|
||||
@Validated
|
||||
public class PrisonerController {
|
||||
|
||||
@Resource
|
||||
private PrisonerService prisonerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新增服刑人员")
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:create')")
|
||||
public CommonResult<Long> createPrisoner(@Valid @RequestBody PrisonerSaveReqVO reqVO) {
|
||||
Long id = prisonerService.createPrisoner(reqVO);
|
||||
return success(id);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改服刑人员")
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:update')")
|
||||
public CommonResult<Boolean> updatePrisoner(@Valid @RequestBody PrisonerSaveReqVO reqVO) {
|
||||
prisonerService.updatePrisoner(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服刑人员")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:delete')")
|
||||
public CommonResult<Boolean> deletePrisoner(@RequestParam("id") Long id) {
|
||||
prisonerService.deletePrisoner(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除服刑人员")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:delete')")
|
||||
public CommonResult<Boolean> deletePrisonerList(@RequestParam("ids") List<Long> ids) {
|
||||
prisonerService.deletePrisonerList(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取服刑人员详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<PrisonerRespVO> getPrisoner(@RequestParam("id") Long id) {
|
||||
PrisonerDO prisoner = prisonerService.getPrisoner(id);
|
||||
return success(PrisonerConvert.INSTANCE.convert(prisoner));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取服刑人员分页列表")
|
||||
public CommonResult<PageResult<PrisonerRespVO>> getPrisonerPage(@Valid PrisonerPageReqVO reqVO) {
|
||||
PageResult<PrisonerDO> pageResult = prisonerService.getPrisonerPage(reqVO);
|
||||
return success(PrisonerConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/get-by-no")
|
||||
@Operation(summary = "根据服刑人员编号获取服刑人员")
|
||||
@Parameter(name = "prisonerNo", description = "服刑人员编号", required = true)
|
||||
public CommonResult<PrisonerRespVO> getPrisonerByNo(@RequestParam("prisonerNo") String prisonerNo) {
|
||||
PrisonerDO prisoner = prisonerService.getPrisonerByNo(prisonerNo);
|
||||
return success(PrisonerConvert.INSTANCE.convert(prisoner));
|
||||
}
|
||||
|
||||
@PostMapping("/export-excel")
|
||||
@Operation(summary = "导出服刑人员 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:export')")
|
||||
public void exportExcel(HttpServletResponse response, @Valid PrisonerPageReqVO reqVO) throws IOException {
|
||||
PageResult<PrisonerDO> pageResult = prisonerService.getPrisonerPage(reqVO);
|
||||
List<PrisonerExcelVO> excelVOs = PrisonerConvert.INSTANCE.convertExcelList(pageResult.getList());
|
||||
ExcelUtils.write(response, "服刑人员数据.xls", "服刑人员列表", PrisonerExcelVO.class, excelVOs);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Excel VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Data
|
||||
@HeadRowHeight(30)
|
||||
public class PrisonerExcelVO {
|
||||
|
||||
@ExcelProperty("服刑人员编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("性别")
|
||||
private Integer gender;
|
||||
|
||||
@ExcelProperty("出生日期")
|
||||
private LocalDate birthday;
|
||||
|
||||
@ExcelProperty("身份证号")
|
||||
private String idCard;
|
||||
|
||||
@ExcelProperty("民族")
|
||||
private String ethnicity;
|
||||
|
||||
@ExcelProperty("籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
@ExcelProperty("文化程度")
|
||||
private Integer education;
|
||||
|
||||
@ExcelProperty("职业")
|
||||
private String occupation;
|
||||
|
||||
@ExcelProperty("罪名")
|
||||
private String crime;
|
||||
|
||||
@ExcelProperty("刑期(年)")
|
||||
private Integer sentenceYears;
|
||||
|
||||
@ExcelProperty("刑期(月)")
|
||||
private Integer sentenceMonths;
|
||||
|
||||
@ExcelProperty("入狱日期")
|
||||
private LocalDate imprisonmentDate;
|
||||
|
||||
@ExcelProperty("释放日期")
|
||||
private LocalDate releaseDate;
|
||||
|
||||
@ExcelProperty("监管等级")
|
||||
private Integer supervisionLevel;
|
||||
|
||||
@ExcelProperty("风险等级")
|
||||
private Integer riskLevel;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 服刑人员分页查询 Request VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PrisonerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "服刑人员编号", example = "ZF2024001")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "姓名", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "身份证号", example = "310101199001011234")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "罪名", example = "盗窃罪")
|
||||
private String crime;
|
||||
|
||||
@Schema(description = "监管等级", example = "2")
|
||||
private Integer supervisionLevel;
|
||||
|
||||
@Schema(description = "风险等级", example = "1")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "入狱日期开始", example = "2024-01-01")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate imprisonmentDateStart;
|
||||
|
||||
@Schema(description = "入狱日期结束", example = "2024-12-31")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate imprisonmentDateEnd;
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Response VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Data
|
||||
public class PrisonerRespVO {
|
||||
|
||||
@Schema(description = "服刑人员ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "服刑人员编号", example = "ZF2024001")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "姓名", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "性别名称", example = "男")
|
||||
private String genderName;
|
||||
|
||||
@Schema(description = "出生日期", example = "1990-01-01")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "身份证号", example = "310101199001011234")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "民族", example = "汉族")
|
||||
private String ethnicity;
|
||||
|
||||
@Schema(description = "籍贯", example = "上海")
|
||||
private String nativePlace;
|
||||
|
||||
@Schema(description = "文化程度", example = "3")
|
||||
private Integer education;
|
||||
|
||||
@Schema(description = "文化程度名称", example = "初中")
|
||||
private String educationName;
|
||||
|
||||
@Schema(description = "职业", example = "无业")
|
||||
private String occupation;
|
||||
|
||||
@Schema(description = "家庭住址", example = "上海市浦东新区xxx")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "罪名", example = "盗窃罪")
|
||||
private String crime;
|
||||
|
||||
@Schema(description = "刑期(年)", example = "3")
|
||||
private Integer sentenceYears;
|
||||
|
||||
@Schema(description = "刑期(月)", example = "6")
|
||||
private Integer sentenceMonths;
|
||||
|
||||
@Schema(description = "入狱日期", example = "2024-01-01")
|
||||
private LocalDate imprisonmentDate;
|
||||
|
||||
@Schema(description = "释放日期", example = "2027-07-01")
|
||||
private LocalDate releaseDate;
|
||||
|
||||
@Schema(description = "监管等级", example = "2")
|
||||
private Integer supervisionLevel;
|
||||
|
||||
@Schema(description = "监管等级名称", example = "普管级")
|
||||
private String supervisionLevelName;
|
||||
|
||||
@Schema(description = "风险等级", example = "1")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险等级名称", example = "低风险")
|
||||
private String riskLevelName;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监区名称", example = "一监区")
|
||||
private String prisonAreaName;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "监室名称", example = "101监室")
|
||||
private String prisonCellName;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "状态名称", example = "在押")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "备注", example = "无")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", example = "2024-01-01 10:00:00")
|
||||
private String createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 服刑人员信息创建/更新 Request VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Data
|
||||
public class PrisonerSaveReqVO {
|
||||
|
||||
@Schema(description = "服刑人员ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "服刑人员编号", example = "ZF2024001")
|
||||
@NotBlank(message = "服刑人员编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "姓名", example = "张三")
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1", required = true)
|
||||
@NotNull(message = "性别不能为空")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "出生日期", example = "1990-01-01")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "身份证号", example = "310101199001011234")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "民族", example = "汉族")
|
||||
private String ethnicity;
|
||||
|
||||
@Schema(description = "籍贯", example = "上海")
|
||||
private String nativePlace;
|
||||
|
||||
@Schema(description = "文化程度", example = "3")
|
||||
private Integer education;
|
||||
|
||||
@Schema(description = "职业", example = "无业")
|
||||
private String occupation;
|
||||
|
||||
@Schema(description = "家庭住址", example = "上海市浦东新区xxx")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "罪名", example = "盗窃罪", required = true)
|
||||
@NotBlank(message = "罪名不能为空")
|
||||
private String crime;
|
||||
|
||||
@Schema(description = "刑期(年)", example = "3")
|
||||
private Integer sentenceYears;
|
||||
|
||||
@Schema(description = "刑期(月)", example = "6")
|
||||
private Integer sentenceMonths;
|
||||
|
||||
@Schema(description = "入狱日期", example = "2024-01-01", required = true)
|
||||
@NotNull(message = "入狱日期不能为空")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate imprisonmentDate;
|
||||
|
||||
@Schema(description = "释放日期", example = "2027-07-01")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate releaseDate;
|
||||
|
||||
@Schema(description = "监管等级", example = "2")
|
||||
private Integer supervisionLevel;
|
||||
|
||||
@Schema(description = "风险等级", example = "1")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "无")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.question;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.question.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.question.QuestionDO;
|
||||
import cn.iocoder.yudao.module.prison.service.question.QuestionService;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷问题")
|
||||
@RestController
|
||||
@RequestMapping("/prison/question")
|
||||
@Validated
|
||||
public class PrisonQuestionController {
|
||||
|
||||
@Resource
|
||||
private QuestionService questionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:create')")
|
||||
public CommonResult<Long> createQuestion(@Valid @RequestBody QuestionSaveReqVO createReqVO) {
|
||||
return success(questionService.createQuestion(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:update')")
|
||||
public CommonResult<Boolean> updateQuestion(@Valid @RequestBody QuestionSaveReqVO updateReqVO) {
|
||||
questionService.updateQuestion(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除问卷问题")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:delete')")
|
||||
public CommonResult<Boolean> deleteQuestion(@RequestParam("id") Long id) {
|
||||
questionService.deleteQuestion(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionList(@RequestParam("ids") List<Long> ids) {
|
||||
questionService.deleteQuestionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得问卷问题")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:query')")
|
||||
public CommonResult<QuestionRespVO> getQuestion(@RequestParam("id") Long id) {
|
||||
QuestionDO question = questionService.getQuestion(id);
|
||||
return success(BeanUtils.toBean(question, QuestionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得问卷问题分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:query')")
|
||||
public CommonResult<PageResult<QuestionRespVO>> getQuestionPage(@Valid QuestionPageReqVO pageReqVO) {
|
||||
PageResult<QuestionDO> pageResult = questionService.getQuestionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/batch-update")
|
||||
@Operation(summary = "批量更新问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:update')")
|
||||
public CommonResult<Boolean> batchUpdateQuestion(@Valid @RequestBody QuestionBatchUpdateReqVO reqVO) {
|
||||
// 转换为 Service 需要的格式
|
||||
List<QuestionSaveReqVO> updateList = new ArrayList<>();
|
||||
for (QuestionBatchUpdateReqVO.QuestionUpdateItem item : reqVO.getQuestions()) {
|
||||
QuestionSaveReqVO saveReqVO = new QuestionSaveReqVO();
|
||||
saveReqVO.setId(item.getId());
|
||||
saveReqVO.setPartName(item.getPartName());
|
||||
saveReqVO.setPartSort(item.getPartSort());
|
||||
saveReqVO.setSort(item.getSort());
|
||||
updateList.add(saveReqVO);
|
||||
}
|
||||
questionService.batchUpdateQuestion(updateList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出问卷问题 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportQuestionExcel(@Valid QuestionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<QuestionDO> list = questionService.getQuestionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷问题.xls", "数据", QuestionRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.question.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷问题批量更新 Request VO")
|
||||
@Data
|
||||
public class QuestionBatchUpdateReqVO {
|
||||
|
||||
@Schema(description = "问题更新列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "更新列表不能为空")
|
||||
private List<QuestionUpdateItem> questions;
|
||||
|
||||
@Schema(description = "问题更新项")
|
||||
@Data
|
||||
public static class QuestionUpdateItem {
|
||||
|
||||
@Schema(description = "问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "问题ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分区名称")
|
||||
private String partName;
|
||||
|
||||
@Schema(description = "分区排序")
|
||||
private Integer partSort;
|
||||
|
||||
@Schema(description = "问题排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.question.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷问题分页 Request VO")
|
||||
@Data
|
||||
public class QuestionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "所属问卷ID", example = "2967")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问题标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "选项JSON,格式如:[{label:选项1,score:10},...]")
|
||||
private String options;
|
||||
|
||||
@Schema(description = "分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否必答")
|
||||
private Boolean isRequired;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.question.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷问题 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class QuestionRespVO {
|
||||
|
||||
@Schema(description = "问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1324")
|
||||
@ExcelProperty("问题ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2967")
|
||||
@ExcelProperty("所属问卷ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问题标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("问题标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("问题类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "选项JSON")
|
||||
@ExcelProperty("选项")
|
||||
private String options;
|
||||
|
||||
@Schema(description = "分值")
|
||||
@ExcelProperty("分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否必答")
|
||||
@ExcelProperty("是否必答")
|
||||
private Boolean isRequired;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
|
||||
@Schema(description = "分区名称")
|
||||
@ExcelProperty("分区名称")
|
||||
private String partName;
|
||||
|
||||
@Schema(description = "分区排序")
|
||||
@ExcelProperty("分区排序")
|
||||
private Integer partSort;
|
||||
|
||||
@Schema(description = "帮助说明文字")
|
||||
@ExcelProperty("帮助说明")
|
||||
private String helpText;
|
||||
|
||||
@Schema(description = "占位提示")
|
||||
private String placeholder;
|
||||
|
||||
@Schema(description = "默认值")
|
||||
private String defaultValue;
|
||||
|
||||
@Schema(description = "自动填充类型:NONE-无 AUTO-自动填充 MANUAL-手动输入")
|
||||
private String autoFillType;
|
||||
|
||||
@Schema(description = "自动填充来源")
|
||||
private String autoFillSource;
|
||||
|
||||
@Schema(description = "显示条件JSON")
|
||||
private String displayCondition;
|
||||
|
||||
@Schema(description = "最小值")
|
||||
private Integer minValue;
|
||||
|
||||
@Schema(description = "最大值")
|
||||
private Integer maxValue;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.question.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷问题新增/修改 Request VO")
|
||||
@Data
|
||||
public class QuestionSaveReqVO {
|
||||
|
||||
@Schema(description = "问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1324")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2967")
|
||||
@NotNull(message = "所属问卷ID不能为空")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问题标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "问题标题不能为空")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "问题类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "选项JSON,格式如:[{label:选项1,score:10,isOther:false},...]")
|
||||
private String options;
|
||||
|
||||
@Schema(description = "分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否必答")
|
||||
private Boolean isRequired;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
|
||||
@Schema(description = "分区名称(Part名称)")
|
||||
private String partName;
|
||||
|
||||
@Schema(description = "分区排序")
|
||||
private Integer partSort;
|
||||
|
||||
@Schema(description = "帮助说明文字")
|
||||
private String helpText;
|
||||
|
||||
@Schema(description = "占位提示")
|
||||
private String placeholder;
|
||||
|
||||
@Schema(description = "默认值")
|
||||
private String defaultValue;
|
||||
|
||||
@Schema(description = "自动填充类型:NONE-无 AUTO-自动填充 MANUAL-手动输入")
|
||||
private String autoFillType;
|
||||
|
||||
@Schema(description = "自动填充来源:dict:字典类型 / field:字段名")
|
||||
private String autoFillSource;
|
||||
|
||||
@Schema(description = "显示条件JSON")
|
||||
private String displayCondition;
|
||||
|
||||
@Schema(description = "最小值(数字/评分题)")
|
||||
private Integer minValue;
|
||||
|
||||
@Schema(description = "最大值(数字/评分题)")
|
||||
private Integer maxValue;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnaire;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire.QuestionnaireDO;
|
||||
import cn.iocoder.yudao.module.prison.service.questionnaire.QuestionnaireService;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷模板")
|
||||
@RestController
|
||||
@RequestMapping("/prison/questionnaire")
|
||||
@Validated
|
||||
public class PrisonQuestionnaireController {
|
||||
|
||||
@Resource
|
||||
private QuestionnaireService questionnaireService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:create')")
|
||||
public CommonResult<Long> createQuestionnaire(@Valid @RequestBody QuestionnaireSaveReqVO createReqVO) {
|
||||
return success(questionnaireService.createQuestionnaire(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:update')")
|
||||
public CommonResult<Boolean> updateQuestionnaire(@Valid @RequestBody QuestionnaireSaveReqVO updateReqVO) {
|
||||
questionnaireService.updateQuestionnaire(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除问卷模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionnaire(@RequestParam("id") Long id) {
|
||||
questionnaireService.deleteQuestionnaire(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionnaireList(@RequestParam("ids") List<Long> ids) {
|
||||
questionnaireService.deleteQuestionnaireListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得问卷模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:query')")
|
||||
public CommonResult<QuestionnaireRespVO> getQuestionnaire(@RequestParam("id") Long id) {
|
||||
QuestionnaireDO questionnaire = questionnaireService.getQuestionnaire(id);
|
||||
return success(BeanUtils.toBean(questionnaire, QuestionnaireRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得问卷模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:query')")
|
||||
public CommonResult<PageResult<QuestionnaireRespVO>> getQuestionnairePage(@Valid QuestionnairePageReqVO pageReqVO) {
|
||||
PageResult<QuestionnaireDO> pageResult = questionnaireService.getQuestionnairePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionnaireRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出问卷模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportQuestionnaireExcel(@Valid QuestionnairePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<QuestionnaireDO> list = questionnaireService.getQuestionnairePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷模板.xls", "数据", QuestionnaireRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionnaireRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷模板分页 Request VO")
|
||||
@Data
|
||||
public class QuestionnairePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "问卷标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问卷类型:1-心理测评 2-行为评估 3-满意度调查", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "问卷说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "及格分")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-已发布 3-已禁用", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷模板 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class QuestionnaireRespVO {
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26045")
|
||||
@ExcelProperty("问卷ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "问卷标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("问卷标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问卷类型:1-心理测评 2-行为评估 3-满意度调查", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("问卷类型:1-心理测评 2-行为评估 3-满意度调查")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "问卷说明", example = "你猜")
|
||||
@ExcelProperty("问卷说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "总分")
|
||||
@ExcelProperty("总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "及格分")
|
||||
@ExcelProperty("及格分")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-已发布 3-已禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态:1-草稿 2-已发布 3-已禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷模板新增/修改 Request VO")
|
||||
@Data
|
||||
public class QuestionnaireSaveReqVO {
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26045")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "问卷标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "问卷标题不能为空")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "问卷类型:1-心理测评 2-行为评估 3-满意度调查", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "问卷类型:1-心理测评 2-行为评估 3-满意度调查不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "问卷说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "及格分")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-已发布 3-已禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态:1-草稿 2-已发布 3-已禁用不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord.QuestionnaireRecordDO;
|
||||
import cn.iocoder.yudao.module.prison.service.questionnairerecord.QuestionnaireRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷答题记录")
|
||||
@RestController
|
||||
@RequestMapping("/prison/questionnaire-record")
|
||||
@Validated
|
||||
public class PrisonQuestionnaireRecordController {
|
||||
|
||||
@Resource
|
||||
private QuestionnaireRecordService questionnaireRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:create')")
|
||||
public CommonResult<Long> createQuestionnaireRecord(@Valid @RequestBody QuestionnaireRecordSaveReqVO createReqVO) {
|
||||
return success(questionnaireRecordService.createQuestionnaireRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新问卷答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:update')")
|
||||
public CommonResult<Boolean> updateQuestionnaireRecord(@Valid @RequestBody QuestionnaireRecordSaveReqVO updateReqVO) {
|
||||
questionnaireRecordService.updateQuestionnaireRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除问卷答题记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionnaireRecord(@RequestParam("id") Long id) {
|
||||
questionnaireRecordService.deleteQuestionnaireRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除问卷答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionnaireRecordList(@RequestParam("ids") List<Long> ids) {
|
||||
questionnaireRecordService.deleteQuestionnaireRecordListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得问卷答题记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<QuestionnaireRecordRespVO> getQuestionnaireRecord(@RequestParam("id") Long id) {
|
||||
QuestionnaireRecordDO questionnaireRecord = questionnaireRecordService.getQuestionnaireRecord(id);
|
||||
return success(BeanUtils.toBean(questionnaireRecord, QuestionnaireRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得问卷答题记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<PageResult<QuestionnaireRecordRespVO>> getQuestionnaireRecordPage(@Valid QuestionnaireRecordPageReqVO pageReqVO) {
|
||||
PageResult<QuestionnaireRecordDO> pageResult = questionnaireRecordService.getQuestionnaireRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionnaireRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出问卷答题记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportQuestionnaireRecordExcel(@Valid QuestionnaireRecordPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<QuestionnaireRecordDO> list = questionnaireRecordService.getQuestionnaireRecordPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷答题记录.xls", "数据", QuestionnaireRecordRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionnaireRecordRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录分页 Request VO")
|
||||
@Data
|
||||
public class QuestionnaireRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "问卷ID", example = "18966")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID", example = "4071")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "答题时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] answerTime;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class QuestionnaireRecordRespVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8596")
|
||||
@ExcelProperty("记录ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18966")
|
||||
@ExcelProperty("问卷ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4071")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
@ExcelProperty("得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
@ExcelProperty("是否及格:1-及格 2-不及格")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "答题时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("答题时间")
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-已完成 2-已过期")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class QuestionnaireRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8596")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18966")
|
||||
@NotNull(message = "问卷ID不能为空")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4071")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "答题时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "答题时间不能为空")
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-已完成 2-已过期不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment.RiskAssessmentDO;
|
||||
import cn.iocoder.yudao.module.prison.service.riskassessment.RiskAssessmentService;
|
||||
|
||||
@Tag(name = "管理后台 - 危险评估")
|
||||
@RestController
|
||||
@RequestMapping("/prison/risk-assessment")
|
||||
@Validated
|
||||
public class PrisonRiskAssessmentController {
|
||||
|
||||
@Resource
|
||||
private RiskAssessmentService riskAssessmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:create')")
|
||||
public CommonResult<Long> createRiskAssessment(@Valid @RequestBody RiskAssessmentSaveReqVO createReqVO) {
|
||||
return success(riskAssessmentService.createRiskAssessment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:update')")
|
||||
public CommonResult<Boolean> updateRiskAssessment(@Valid @RequestBody RiskAssessmentSaveReqVO updateReqVO) {
|
||||
riskAssessmentService.updateRiskAssessment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除危险评估")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteRiskAssessment(@RequestParam("id") Long id) {
|
||||
riskAssessmentService.deleteRiskAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteRiskAssessmentList(@RequestParam("ids") List<Long> ids) {
|
||||
riskAssessmentService.deleteRiskAssessmentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得危险评估")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<RiskAssessmentRespVO> getRiskAssessment(@RequestParam("id") Long id) {
|
||||
RiskAssessmentDO riskAssessment = riskAssessmentService.getRiskAssessment(id);
|
||||
return success(BeanUtils.toBean(riskAssessment, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得危险评估分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<PageResult<RiskAssessmentRespVO>> getRiskAssessmentPage(@Valid RiskAssessmentPageReqVO pageReqVO) {
|
||||
PageResult<RiskAssessmentDO> pageResult = riskAssessmentService.getRiskAssessmentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出危险评估 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRiskAssessmentExcel(@Valid RiskAssessmentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RiskAssessmentDO> list = riskAssessmentService.getRiskAssessmentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "危险评估.xls", "数据", RiskAssessmentRespVO.class,
|
||||
BeanUtils.toBean(list, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 危险评估分页 Request VO")
|
||||
@Data
|
||||
public class RiskAssessmentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "罪犯ID", example = "7687")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "评估类型:1-入狱评估 2-定期评估 3-专项评估", example = "2")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] assessmentDate;
|
||||
|
||||
@Schema(description = "暴力倾向得分")
|
||||
private BigDecimal violenceScore;
|
||||
|
||||
@Schema(description = "脱逃倾向得分")
|
||||
private BigDecimal escapeScore;
|
||||
|
||||
@Schema(description = "自杀倾向得分")
|
||||
private BigDecimal suicideScore;
|
||||
|
||||
@Schema(description = "综合得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险因素")
|
||||
private String riskFactors;
|
||||
|
||||
@Schema(description = "管控建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "评估人ID", example = "11993")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "评估人姓名", example = "赵六")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "下次评估日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] nextAssessmentDate;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 危险评估 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RiskAssessmentRespVO {
|
||||
|
||||
@Schema(description = "评估ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13958")
|
||||
@ExcelProperty("评估ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7687")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "评估类型:1-入狱评估 2-定期评估 3-专项评估", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("评估类型:1-入狱评估 2-定期评估 3-专项评估")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估日期")
|
||||
private LocalDate assessmentDate;
|
||||
|
||||
@Schema(description = "暴力倾向得分")
|
||||
@ExcelProperty("暴力倾向得分")
|
||||
private BigDecimal violenceScore;
|
||||
|
||||
@Schema(description = "脱逃倾向得分")
|
||||
@ExcelProperty("脱逃倾向得分")
|
||||
private BigDecimal escapeScore;
|
||||
|
||||
@Schema(description = "自杀倾向得分")
|
||||
@ExcelProperty("自杀倾向得分")
|
||||
private BigDecimal suicideScore;
|
||||
|
||||
@Schema(description = "综合得分")
|
||||
@ExcelProperty("综合得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险因素")
|
||||
@ExcelProperty("风险因素")
|
||||
private String riskFactors;
|
||||
|
||||
@Schema(description = "管控建议")
|
||||
@ExcelProperty("管控建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "评估人ID", example = "11993")
|
||||
@ExcelProperty("评估人ID")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "评估人姓名", example = "赵六")
|
||||
@ExcelProperty("评估人姓名")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "下次评估日期")
|
||||
@ExcelProperty("下次评估日期")
|
||||
private LocalDate nextAssessmentDate;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-待审核 2-已通过")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 危险评估新增/修改 Request VO")
|
||||
@Data
|
||||
public class RiskAssessmentSaveReqVO {
|
||||
|
||||
@Schema(description = "评估ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13958")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7687")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "评估类型:1-入狱评估 2-定期评估 3-专项评估", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "评估类型:1-入狱评估 2-定期评估 3-专项评估不能为空")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估日期不能为空")
|
||||
private LocalDate assessmentDate;
|
||||
|
||||
@Schema(description = "暴力倾向得分")
|
||||
private BigDecimal violenceScore;
|
||||
|
||||
@Schema(description = "脱逃倾向得分")
|
||||
private BigDecimal escapeScore;
|
||||
|
||||
@Schema(description = "自杀倾向得分")
|
||||
private BigDecimal suicideScore;
|
||||
|
||||
@Schema(description = "综合得分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险不能为空")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险因素")
|
||||
private String riskFactors;
|
||||
|
||||
@Schema(description = "管控建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "评估人ID", example = "11993")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "评估人姓名", example = "赵六")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "下次评估日期")
|
||||
private LocalDate nextAssessmentDate;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-待审核 2-已通过不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.score;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.score.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.score.ScoreDO;
|
||||
import cn.iocoder.yudao.module.prison.service.score.ScoreService;
|
||||
|
||||
@Tag(name = "管理后台 - 计分考核")
|
||||
@RestController
|
||||
@RequestMapping("/prison/score")
|
||||
@Validated
|
||||
public class PrisonScoreController {
|
||||
|
||||
@Resource
|
||||
private ScoreService scoreService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建计分考核")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:create')")
|
||||
public CommonResult<Long> createScore(@Valid @RequestBody ScoreSaveReqVO createReqVO) {
|
||||
return success(scoreService.createScore(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新计分考核")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:update')")
|
||||
public CommonResult<Boolean> updateScore(@Valid @RequestBody ScoreSaveReqVO updateReqVO) {
|
||||
scoreService.updateScore(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除计分考核")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:delete')")
|
||||
public CommonResult<Boolean> deleteScore(@RequestParam("id") Long id) {
|
||||
scoreService.deleteScore(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除计分考核")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:delete')")
|
||||
public CommonResult<Boolean> deleteScoreList(@RequestParam("ids") List<Long> ids) {
|
||||
scoreService.deleteScoreListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得计分考核")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:query')")
|
||||
public CommonResult<ScoreRespVO> getScore(@RequestParam("id") Long id) {
|
||||
ScoreDO score = scoreService.getScore(id);
|
||||
return success(BeanUtils.toBean(score, ScoreRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得计分考核分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:query')")
|
||||
public CommonResult<PageResult<ScoreRespVO>> getScorePage(@Valid ScorePageReqVO pageReqVO) {
|
||||
PageResult<ScoreDO> pageResult = scoreService.getScorePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ScoreRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出计分考核 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportScoreExcel(@Valid ScorePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ScoreDO> list = scoreService.getScorePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "计分考核.xls", "数据", ScoreRespVO.class,
|
||||
BeanUtils.toBean(list, ScoreRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.score.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 计分考核分页 Request VO")
|
||||
@Data
|
||||
public class ScorePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "罪犯ID", example = "1070")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "考核年份")
|
||||
private Integer year;
|
||||
|
||||
@Schema(description = "考核月份")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description = "基础分")
|
||||
private BigDecimal baseScore;
|
||||
|
||||
@Schema(description = "加分")
|
||||
private BigDecimal rewardScore;
|
||||
|
||||
@Schema(description = "扣分")
|
||||
private BigDecimal penaltyScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "考核等级:1-优秀 2-良好 3-合格 4-不合格")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "考核人ID", example = "14206")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "考核人姓名", example = "赵六")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过 3-已驳回", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.score.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 计分考核 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ScoreRespVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "451")
|
||||
@ExcelProperty("记录ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1070")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "考核年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("考核年份")
|
||||
private Integer year;
|
||||
|
||||
@Schema(description = "考核月份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("考核月份")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description = "基础分")
|
||||
@ExcelProperty("基础分")
|
||||
private BigDecimal baseScore;
|
||||
|
||||
@Schema(description = "加分")
|
||||
@ExcelProperty("加分")
|
||||
private BigDecimal rewardScore;
|
||||
|
||||
@Schema(description = "扣分")
|
||||
@ExcelProperty("扣分")
|
||||
private BigDecimal penaltyScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
@ExcelProperty("总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "考核等级:1-优秀 2-良好 3-合格 4-不合格")
|
||||
@ExcelProperty("考核等级:1-优秀 2-良好 3-合格 4-不合格")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "考核人ID", example = "14206")
|
||||
@ExcelProperty("考核人ID")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "考核人姓名", example = "赵六")
|
||||
@ExcelProperty("考核人姓名")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过 3-已驳回", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态:1-待审核 2-已通过 3-已驳回")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.score.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 计分考核新增/修改 Request VO")
|
||||
@Data
|
||||
public class ScoreSaveReqVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "451")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1070")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "考核年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "考核年份不能为空")
|
||||
private Integer year;
|
||||
|
||||
@Schema(description = "考核月份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "考核月份不能为空")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description = "基础分")
|
||||
private BigDecimal baseScore;
|
||||
|
||||
@Schema(description = "加分")
|
||||
private BigDecimal rewardScore;
|
||||
|
||||
@Schema(description = "扣分")
|
||||
private BigDecimal penaltyScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "考核等级:1-优秀 2-良好 3-合格 4-不合格")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "考核人ID", example = "14206")
|
||||
private Long assessorId;
|
||||
|
||||
@Schema(description = "考核人姓名", example = "赵六")
|
||||
private String assessorName;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过 3-已驳回", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态:1-待审核 2-已通过 3-已驳回不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.prison.convert.prisoner;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Convert
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrisonerConvert {
|
||||
|
||||
PrisonerConvert INSTANCE = Mappers.getMapper(PrisonerConvert.class);
|
||||
|
||||
PrisonerDO convert(PrisonerSaveReqVO bean);
|
||||
|
||||
PrisonerRespVO convert(PrisonerDO bean);
|
||||
|
||||
List<PrisonerRespVO> convertList(List<PrisonerDO> list);
|
||||
|
||||
PageResult<PrisonerRespVO> convertPage(PageResult<PrisonerDO> page);
|
||||
|
||||
List<PrisonerExcelVO> convertExcelList(List<PrisonerDO> list);
|
||||
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.prison.enums.*;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 DO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@TableName("prison_prisoner")
|
||||
@KeySequence("prison_prisoner_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PrisonerDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服刑人员编号
|
||||
*/
|
||||
private String prisonerNo;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private GenderEnum gender;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private LocalDate birthday;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
private String ethnicity;
|
||||
|
||||
/**
|
||||
* 籍贯
|
||||
*/
|
||||
private String nativePlace;
|
||||
|
||||
/**
|
||||
* 文化程度
|
||||
*/
|
||||
private EducationEnum education;
|
||||
|
||||
/**
|
||||
* 职业
|
||||
*/
|
||||
private String occupation;
|
||||
|
||||
/**
|
||||
* 家庭住址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 罪名
|
||||
*/
|
||||
private String crime;
|
||||
|
||||
/**
|
||||
* 刑期(年)
|
||||
*/
|
||||
private Integer sentenceYears;
|
||||
|
||||
/**
|
||||
* 刑期(月)
|
||||
*/
|
||||
private Integer sentenceMonths;
|
||||
|
||||
/**
|
||||
* 入狱日期
|
||||
*/
|
||||
private LocalDate imprisonmentDate;
|
||||
|
||||
/**
|
||||
* 释放日期
|
||||
*/
|
||||
private LocalDate releaseDate;
|
||||
|
||||
/**
|
||||
* 当前监管等级
|
||||
*/
|
||||
private SupervisionLevelEnum supervisionLevel;
|
||||
|
||||
/**
|
||||
* 当前风险等级
|
||||
*/
|
||||
private RiskLevelEnum riskLevel;
|
||||
|
||||
/**
|
||||
* 当前监区ID
|
||||
*/
|
||||
private Long prisonAreaId;
|
||||
|
||||
/**
|
||||
* 当前监室ID
|
||||
*/
|
||||
private Long prisonCellId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private PrisonerStatusEnum status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.area;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 监区信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_area")
|
||||
@KeySequence("prison_area_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AreaDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 监区ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 监区名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 监区编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 容纳人数
|
||||
*/
|
||||
private Integer capacity;
|
||||
/**
|
||||
* 当前人数
|
||||
*/
|
||||
private Integer currentCount;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态:1-启用 2-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.cell;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 监室信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_cell")
|
||||
@KeySequence("prison_cell_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CellDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 监室ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 所属监区ID
|
||||
*/
|
||||
private Long areaId;
|
||||
/**
|
||||
* 监室名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 监室编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 床位数量
|
||||
*/
|
||||
private Integer capacity;
|
||||
/**
|
||||
* 当前人数
|
||||
*/
|
||||
private Integer currentCount;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态:1-启用 2-禁用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.consumption;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 消费记录 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_consumption")
|
||||
@KeySequence("prison_consumption_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ConsumptionDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 罪犯ID
|
||||
*/
|
||||
private Long prisonerId;
|
||||
/**
|
||||
* 罪犯编号
|
||||
*/
|
||||
private String prisonerNo;
|
||||
/**
|
||||
* 类型:1-存款 2-消费 3-转账
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 账户余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String goodsName;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer goodsCount;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private LocalDateTime tradeTime;
|
||||
/**
|
||||
* 状态:1-成功 2-失败
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.question;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 问卷问题 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_question")
|
||||
@KeySequence("prison_question_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 问题ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 所属问卷ID
|
||||
*/
|
||||
private Long questionnaireId;
|
||||
/**
|
||||
* 问题标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 选项JSON:[{label:"选项1",score:10,isOther:false},...]
|
||||
* 日期格式:{min:"起始日期",max:"结束日期"}
|
||||
* 数字格式:{min:0,max:100}
|
||||
*/
|
||||
private String options;
|
||||
/**
|
||||
* 分值
|
||||
*/
|
||||
private BigDecimal score;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 是否必答
|
||||
*/
|
||||
private Boolean isRequired;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
|
||||
/**
|
||||
* 分区名称(Part名称),用于将问题分组
|
||||
*/
|
||||
private String partName;
|
||||
/**
|
||||
* 分区排序(同一问卷内的分区序号)
|
||||
*/
|
||||
private Integer partSort;
|
||||
/**
|
||||
* 帮助说明文字
|
||||
*/
|
||||
private String helpText;
|
||||
/**
|
||||
* 占位提示(填空题/数字题显示)
|
||||
*/
|
||||
private String placeholder;
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
private String defaultValue;
|
||||
/**
|
||||
* 自动填充类型:NONE-无 AUTO-系统自动填充 MANUAL-手动输入
|
||||
*/
|
||||
private String autoFillType;
|
||||
/**
|
||||
* 自动填充来源:dict:字典类型 / field:字段名
|
||||
* 示例:dict:system_user_sex 或 field:prisonerName
|
||||
*/
|
||||
private String autoFillSource;
|
||||
/**
|
||||
* 显示条件JSON:{"field":"字段名","operator":">=","value":"值"}
|
||||
* 示例:{"field":"riskLevel","operator":">=","value":"3"}
|
||||
*/
|
||||
private String displayCondition;
|
||||
/**
|
||||
* 最小值(数字/评分题)
|
||||
*/
|
||||
private Integer minValue;
|
||||
/**
|
||||
* 最大值(数字/评分题)
|
||||
*/
|
||||
private Integer maxValue;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 问卷模板 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_questionnaire")
|
||||
@KeySequence("prison_questionnaire_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionnaireDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 问卷标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 问卷类型:1-心理测评 2-行为评估 3-满意度调查
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 问卷说明
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 总分
|
||||
*/
|
||||
private BigDecimal totalScore;
|
||||
/**
|
||||
* 及格分
|
||||
*/
|
||||
private BigDecimal passScore;
|
||||
/**
|
||||
* 状态:1-草稿 2-已发布 3-已禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
|
||||
/**
|
||||
* 封面图片URL
|
||||
*/
|
||||
private String coverImage;
|
||||
/**
|
||||
* 填写说明
|
||||
*/
|
||||
private String instruction;
|
||||
/**
|
||||
* 预计耗时(分钟)
|
||||
*/
|
||||
private Integer estimatedTime;
|
||||
/**
|
||||
* 分区数量
|
||||
*/
|
||||
private Integer partCount;
|
||||
/**
|
||||
* 是否允许匿名:false-不允许 true-允许
|
||||
*/
|
||||
private Boolean allowAnonymous;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 问卷答题记录 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_questionnaire_record")
|
||||
@KeySequence("prison_questionnaire_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionnaireRecordDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
private Long questionnaireId;
|
||||
/**
|
||||
* 罪犯ID
|
||||
*/
|
||||
private Long prisonerId;
|
||||
/**
|
||||
* 罪犯编号
|
||||
*/
|
||||
private String prisonerNo;
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private BigDecimal totalScore;
|
||||
/**
|
||||
* 是否及格:1-及格 2-不及格
|
||||
*/
|
||||
private Integer passStatus;
|
||||
/**
|
||||
* 答题时间
|
||||
*/
|
||||
private LocalDateTime answerTime;
|
||||
/**
|
||||
* 状态:1-已完成 2-已过期
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 危险评估 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_risk_assessment")
|
||||
@KeySequence("prison_risk_assessment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RiskAssessmentDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 评估ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 罪犯ID
|
||||
*/
|
||||
private Long prisonerId;
|
||||
/**
|
||||
* 罪犯编号
|
||||
*/
|
||||
private String prisonerNo;
|
||||
/**
|
||||
* 评估类型:1-入狱评估 2-定期评估 3-专项评估
|
||||
*/
|
||||
private Integer assessmentType;
|
||||
/**
|
||||
* 评估日期
|
||||
*/
|
||||
private LocalDate assessmentDate;
|
||||
/**
|
||||
* 暴力倾向得分
|
||||
*/
|
||||
private BigDecimal violenceScore;
|
||||
/**
|
||||
* 脱逃倾向得分
|
||||
*/
|
||||
private BigDecimal escapeScore;
|
||||
/**
|
||||
* 自杀倾向得分
|
||||
*/
|
||||
private BigDecimal suicideScore;
|
||||
/**
|
||||
* 综合得分
|
||||
*/
|
||||
private BigDecimal totalScore;
|
||||
/**
|
||||
* 风险等级:1-低风险 2-中风险 3-高风险 4-极高风险
|
||||
*/
|
||||
private Integer riskLevel;
|
||||
/**
|
||||
* 风险因素
|
||||
*/
|
||||
private String riskFactors;
|
||||
/**
|
||||
* 管控建议
|
||||
*/
|
||||
private String suggestions;
|
||||
/**
|
||||
* 评估人ID
|
||||
*/
|
||||
private Long assessorId;
|
||||
/**
|
||||
* 评估人姓名
|
||||
*/
|
||||
private String assessorName;
|
||||
/**
|
||||
* 下次评估日期
|
||||
*/
|
||||
private LocalDate nextAssessmentDate;
|
||||
/**
|
||||
* 状态:1-待审核 2-已通过
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.dataobject.score;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 计分考核 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("prison_score")
|
||||
@KeySequence("prison_score_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ScoreDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 罪犯ID
|
||||
*/
|
||||
private Long prisonerId;
|
||||
/**
|
||||
* 罪犯编号
|
||||
*/
|
||||
private String prisonerNo;
|
||||
/**
|
||||
* 考核年份
|
||||
*/
|
||||
private Integer year;
|
||||
/**
|
||||
* 考核月份
|
||||
*/
|
||||
private Integer month;
|
||||
/**
|
||||
* 基础分
|
||||
*/
|
||||
private BigDecimal baseScore;
|
||||
/**
|
||||
* 加分
|
||||
*/
|
||||
private BigDecimal rewardScore;
|
||||
/**
|
||||
* 扣分
|
||||
*/
|
||||
private BigDecimal penaltyScore;
|
||||
/**
|
||||
* 总分
|
||||
*/
|
||||
private BigDecimal totalScore;
|
||||
/**
|
||||
* 考核等级:1-优秀 2-良好 3-合格 4-不合格
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 考核人ID
|
||||
*/
|
||||
private Long assessorId;
|
||||
/**
|
||||
* 考核人姓名
|
||||
*/
|
||||
private String assessorName;
|
||||
/**
|
||||
* 状态:1-待审核 2-已通过 3-已驳回
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Mapper
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrisonerMapper extends BaseMapperX<PrisonerDO> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.area;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.area.AreaDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.area.vo.*;
|
||||
|
||||
/**
|
||||
* 监区信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface AreaMapper extends BaseMapperX<AreaDO> {
|
||||
|
||||
default PageResult<AreaDO> selectPage(AreaPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AreaDO>()
|
||||
.likeIfPresent(AreaDO::getName, reqVO.getName())
|
||||
.eqIfPresent(AreaDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(AreaDO::getType, reqVO.getType())
|
||||
.eqIfPresent(AreaDO::getCapacity, reqVO.getCapacity())
|
||||
.eqIfPresent(AreaDO::getCurrentCount, reqVO.getCurrentCount())
|
||||
.eqIfPresent(AreaDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(AreaDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(AreaDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(AreaDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(AreaDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.cell;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.cell.CellDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.cell.vo.*;
|
||||
|
||||
/**
|
||||
* 监室信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CellMapper extends BaseMapperX<CellDO> {
|
||||
|
||||
default PageResult<CellDO> selectPage(CellPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CellDO>()
|
||||
.eqIfPresent(CellDO::getAreaId, reqVO.getAreaId())
|
||||
.likeIfPresent(CellDO::getName, reqVO.getName())
|
||||
.eqIfPresent(CellDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(CellDO::getCapacity, reqVO.getCapacity())
|
||||
.eqIfPresent(CellDO::getCurrentCount, reqVO.getCurrentCount())
|
||||
.eqIfPresent(CellDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(CellDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(CellDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(CellDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CellDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.consumption;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.consumption.vo.*;
|
||||
|
||||
/**
|
||||
* 消费记录 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConsumptionMapper extends BaseMapperX<ConsumptionDO> {
|
||||
|
||||
default PageResult<ConsumptionDO> selectPage(ConsumptionPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionDO>()
|
||||
.eqIfPresent(ConsumptionDO::getPrisonerId, reqVO.getPrisonerId())
|
||||
.eqIfPresent(ConsumptionDO::getPrisonerNo, reqVO.getPrisonerNo())
|
||||
.eqIfPresent(ConsumptionDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ConsumptionDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(ConsumptionDO::getBalance, reqVO.getBalance())
|
||||
.likeIfPresent(ConsumptionDO::getGoodsName, reqVO.getGoodsName())
|
||||
.eqIfPresent(ConsumptionDO::getGoodsCount, reqVO.getGoodsCount())
|
||||
.eqIfPresent(ConsumptionDO::getOrderNo, reqVO.getOrderNo())
|
||||
.betweenIfPresent(ConsumptionDO::getTradeTime, reqVO.getTradeTime())
|
||||
.eqIfPresent(ConsumptionDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ConsumptionDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ConsumptionDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ConsumptionDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.question;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.question.QuestionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.question.vo.*;
|
||||
|
||||
/**
|
||||
* 问卷问题 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuestionMapper extends BaseMapperX<QuestionDO> {
|
||||
|
||||
default PageResult<QuestionDO> selectPage(QuestionPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<QuestionDO>()
|
||||
.eqIfPresent(QuestionDO::getQuestionnaireId, reqVO.getQuestionnaireId())
|
||||
.eqIfPresent(QuestionDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(QuestionDO::getType, reqVO.getType())
|
||||
.eqIfPresent(QuestionDO::getOptions, reqVO.getOptions())
|
||||
.eqIfPresent(QuestionDO::getScore, reqVO.getScore())
|
||||
.eqIfPresent(QuestionDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(QuestionDO::getIsRequired, reqVO.getIsRequired())
|
||||
.betweenIfPresent(QuestionDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(QuestionDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.questionnaire;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire.QuestionnaireDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo.*;
|
||||
|
||||
/**
|
||||
* 问卷模板 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuestionnaireMapper extends BaseMapperX<QuestionnaireDO> {
|
||||
|
||||
default PageResult<QuestionnaireDO> selectPage(QuestionnairePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireDO>()
|
||||
.eqIfPresent(QuestionnaireDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(QuestionnaireDO::getType, reqVO.getType())
|
||||
.eqIfPresent(QuestionnaireDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(QuestionnaireDO::getTotalScore, reqVO.getTotalScore())
|
||||
.eqIfPresent(QuestionnaireDO::getPassScore, reqVO.getPassScore())
|
||||
.eqIfPresent(QuestionnaireDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(QuestionnaireDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(QuestionnaireDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.questionnairerecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord.QuestionnaireRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo.*;
|
||||
|
||||
/**
|
||||
* 问卷答题记录 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface QuestionnaireRecordMapper extends BaseMapperX<QuestionnaireRecordDO> {
|
||||
|
||||
default PageResult<QuestionnaireRecordDO> selectPage(QuestionnaireRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireRecordDO>()
|
||||
.eqIfPresent(QuestionnaireRecordDO::getQuestionnaireId, reqVO.getQuestionnaireId())
|
||||
.eqIfPresent(QuestionnaireRecordDO::getPrisonerId, reqVO.getPrisonerId())
|
||||
.eqIfPresent(QuestionnaireRecordDO::getPrisonerNo, reqVO.getPrisonerNo())
|
||||
.eqIfPresent(QuestionnaireRecordDO::getTotalScore, reqVO.getTotalScore())
|
||||
.eqIfPresent(QuestionnaireRecordDO::getPassStatus, reqVO.getPassStatus())
|
||||
.betweenIfPresent(QuestionnaireRecordDO::getAnswerTime, reqVO.getAnswerTime())
|
||||
.eqIfPresent(QuestionnaireRecordDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(QuestionnaireRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(QuestionnaireRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.riskassessment;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment.RiskAssessmentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
|
||||
/**
|
||||
* 危险评估 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface RiskAssessmentMapper extends BaseMapperX<RiskAssessmentDO> {
|
||||
|
||||
default PageResult<RiskAssessmentDO> selectPage(RiskAssessmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RiskAssessmentDO>()
|
||||
.eqIfPresent(RiskAssessmentDO::getPrisonerId, reqVO.getPrisonerId())
|
||||
.eqIfPresent(RiskAssessmentDO::getPrisonerNo, reqVO.getPrisonerNo())
|
||||
.eqIfPresent(RiskAssessmentDO::getAssessmentType, reqVO.getAssessmentType())
|
||||
.betweenIfPresent(RiskAssessmentDO::getAssessmentDate, reqVO.getAssessmentDate())
|
||||
.eqIfPresent(RiskAssessmentDO::getViolenceScore, reqVO.getViolenceScore())
|
||||
.eqIfPresent(RiskAssessmentDO::getEscapeScore, reqVO.getEscapeScore())
|
||||
.eqIfPresent(RiskAssessmentDO::getSuicideScore, reqVO.getSuicideScore())
|
||||
.eqIfPresent(RiskAssessmentDO::getTotalScore, reqVO.getTotalScore())
|
||||
.eqIfPresent(RiskAssessmentDO::getRiskLevel, reqVO.getRiskLevel())
|
||||
.eqIfPresent(RiskAssessmentDO::getRiskFactors, reqVO.getRiskFactors())
|
||||
.eqIfPresent(RiskAssessmentDO::getSuggestions, reqVO.getSuggestions())
|
||||
.eqIfPresent(RiskAssessmentDO::getAssessorId, reqVO.getAssessorId())
|
||||
.likeIfPresent(RiskAssessmentDO::getAssessorName, reqVO.getAssessorName())
|
||||
.betweenIfPresent(RiskAssessmentDO::getNextAssessmentDate, reqVO.getNextAssessmentDate())
|
||||
.eqIfPresent(RiskAssessmentDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(RiskAssessmentDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(RiskAssessmentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RiskAssessmentDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.prison.dal.mysql.score;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.score.ScoreDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.score.vo.*;
|
||||
|
||||
/**
|
||||
* 计分考核 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScoreMapper extends BaseMapperX<ScoreDO> {
|
||||
|
||||
default PageResult<ScoreDO> selectPage(ScorePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ScoreDO>()
|
||||
.eqIfPresent(ScoreDO::getPrisonerId, reqVO.getPrisonerId())
|
||||
.eqIfPresent(ScoreDO::getPrisonerNo, reqVO.getPrisonerNo())
|
||||
.eqIfPresent(ScoreDO::getYear, reqVO.getYear())
|
||||
.eqIfPresent(ScoreDO::getMonth, reqVO.getMonth())
|
||||
.eqIfPresent(ScoreDO::getBaseScore, reqVO.getBaseScore())
|
||||
.eqIfPresent(ScoreDO::getRewardScore, reqVO.getRewardScore())
|
||||
.eqIfPresent(ScoreDO::getPenaltyScore, reqVO.getPenaltyScore())
|
||||
.eqIfPresent(ScoreDO::getTotalScore, reqVO.getTotalScore())
|
||||
.eqIfPresent(ScoreDO::getLevel, reqVO.getLevel())
|
||||
.eqIfPresent(ScoreDO::getAssessorId, reqVO.getAssessorId())
|
||||
.likeIfPresent(ScoreDO::getAssessorName, reqVO.getAssessorName())
|
||||
.eqIfPresent(ScoreDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ScoreDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(ScoreDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ScoreDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
/**
|
||||
* 监狱管理 字典类型的枚举类
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
public interface DictTypeConstants {
|
||||
|
||||
String PRISON_SUPERVISION_LEVEL = "prison_supervision_level"; // 监管等级
|
||||
String PRISON_RISK_LEVEL = "prison_risk_level"; // 风险等级
|
||||
String PRISONER_STATUS = "prisoner_status"; // 服刑人员状态
|
||||
String PRISON_EDUCATION = "prison_education"; // 文化程度
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 文化程度枚举
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EducationEnum {
|
||||
|
||||
ILLITERATE(1, "文盲"),
|
||||
PRIMARY_SCHOOL(2, "小学"),
|
||||
MIDDLE_SCHOOL(3, "初中"),
|
||||
HIGH_SCHOOL(4, "高中"),
|
||||
TECHNICAL_SCHOOL(5, "中专"),
|
||||
COLLEGE(6, "大专"),
|
||||
BACHELOR_OR_ABOVE(7, "本科及以上");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* 监狱管理模块错误码
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
public class ErrorCodeConstants {
|
||||
|
||||
// ========== 服刑人员信息 1xxxx ==========
|
||||
public static final ErrorCode PRISONER_NOT_EXISTS = new ErrorCode(1_000_001, "服刑人员信息不存在");
|
||||
public static final ErrorCode PRISONER_NO_EXISTS = new ErrorCode(1_000_002, "服刑人员编号【{0}】已存在");
|
||||
|
||||
// ========== 监区管理 2xxxx ==========
|
||||
public static final ErrorCode PRISON_AREA_NOT_EXISTS = new ErrorCode(2_000_001, "监区信息不存在");
|
||||
public static final ErrorCode PRISON_AREA_CODE_EXISTS = new ErrorCode(2_000_002, "监区编码【{0}】已存在");
|
||||
|
||||
// ========== 监室管理 3xxxx ==========
|
||||
public static final ErrorCode PRISON_CELL_NOT_EXISTS = new ErrorCode(3_000_001, "监室信息不存在");
|
||||
public static final ErrorCode PRISON_CELL_CODE_EXISTS = new ErrorCode(3_000_002, "监室编码【{0}】已存在");
|
||||
|
||||
// ========== 计分考核 4xxxx ==========
|
||||
public static final ErrorCode PRISON_SCORE_NOT_EXISTS = new ErrorCode(4_000_001, "计分记录不存在");
|
||||
|
||||
// ========== 危险评估 5xxxx ==========
|
||||
public static final ErrorCode PRISON_RISK_NOT_EXISTS = new ErrorCode(5_000_001, "评估记录不存在");
|
||||
|
||||
// ========== 问卷管理 6xxxx ==========
|
||||
public static final ErrorCode PRISON_QUESTIONNAIRE_NOT_EXISTS = new ErrorCode(6_000_001, "问卷不存在");
|
||||
public static final ErrorCode PRISON_QUESTION_NOT_EXISTS = new ErrorCode(6_000_002, "问题不存在");
|
||||
public static final ErrorCode PRISON_QUESTIONNAIRE_RECORD_NOT_EXISTS = new ErrorCode(6_000_003, "问卷答题记录不存在");
|
||||
|
||||
// ========== 消费记录 7xxxx ==========
|
||||
public static final ErrorCode PRISON_CONSUMPTION_NOT_EXISTS = new ErrorCode(7_000_001, "消费记录不存在");
|
||||
|
||||
// ========== 别名 (兼容codegen生成的代码) ==========
|
||||
public static final ErrorCode AREA_NOT_EXISTS = PRISON_AREA_NOT_EXISTS;
|
||||
public static final ErrorCode CELL_NOT_EXISTS = PRISON_CELL_NOT_EXISTS;
|
||||
public static final ErrorCode SCORE_NOT_EXISTS = PRISON_SCORE_NOT_EXISTS;
|
||||
public static final ErrorCode RISK_ASSESSMENT_NOT_EXISTS = PRISON_RISK_NOT_EXISTS;
|
||||
public static final ErrorCode CONSUMPTION_NOT_EXISTS = PRISON_CONSUMPTION_NOT_EXISTS;
|
||||
public static final ErrorCode QUESTIONNAIRE_NOT_EXISTS = PRISON_QUESTIONNAIRE_NOT_EXISTS;
|
||||
public static final ErrorCode QUESTION_NOT_EXISTS = PRISON_QUESTION_NOT_EXISTS;
|
||||
public static final ErrorCode QUESTIONNAIRE_RECORD_NOT_EXISTS = PRISON_QUESTIONNAIRE_RECORD_NOT_EXISTS;
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 性别枚举
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum GenderEnum {
|
||||
|
||||
MALE(1, "男"),
|
||||
FEMALE(2, "女");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 服刑人员状态枚举
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PrisonerStatusEnum {
|
||||
|
||||
IMPRISONED(1, "在押"),
|
||||
PAROLED(2, "假释"),
|
||||
OUTSIDE_EXECUTION(3, "暂予监外执行"),
|
||||
RELEASED(4, "已释放"),
|
||||
DECEASED(5, "已死亡");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 风险等级枚举
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RiskLevelEnum {
|
||||
|
||||
HIGH(1, "高风险"),
|
||||
MEDIUM(2, "中风险"),
|
||||
LOW(3, "低风险");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.prison.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 监管等级枚举
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SupervisionLevelEnum {
|
||||
|
||||
STRICT(1, "严管级"),
|
||||
NORMAL(2, "普管级"),
|
||||
RELAXED(3, "宽管级");
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.prison.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Service 接口
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
public interface PrisonerService {
|
||||
|
||||
/**
|
||||
* 创建服刑人员信息
|
||||
*
|
||||
* @param reqVO 创建信息
|
||||
* @return 服刑人员ID
|
||||
*/
|
||||
Long createPrisoner(PrisonerSaveReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 更新服刑人员信息
|
||||
*
|
||||
* @param reqVO 更新信息
|
||||
*/
|
||||
void updatePrisoner(PrisonerSaveReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 删除服刑人员信息
|
||||
*
|
||||
* @param id 服刑人员ID
|
||||
*/
|
||||
void deletePrisoner(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除服刑人员信息
|
||||
*
|
||||
* @param ids 服刑人员ID列表
|
||||
*/
|
||||
void deletePrisonerList(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取服刑人员信息
|
||||
*
|
||||
* @param id 服刑人员ID
|
||||
* @return 服刑人员信息
|
||||
*/
|
||||
PrisonerDO getPrisoner(Long id);
|
||||
|
||||
/**
|
||||
* 获取服刑人员分页列表
|
||||
*
|
||||
* @param reqVO 查询条件
|
||||
* @return 服刑人员分页列表
|
||||
*/
|
||||
PageResult<PrisonerDO> getPrisonerPage(PrisonerPageReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 根据服刑人员编号获取服刑人员
|
||||
*
|
||||
* @param prisonerNo 服刑人员编号
|
||||
* @return 服刑人员信息
|
||||
*/
|
||||
PrisonerDO getPrisonerByNo(String prisonerNo);
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.area;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.area.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.area.AreaDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 监区信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface AreaService {
|
||||
|
||||
/**
|
||||
* 创建监区信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createArea(@Valid AreaSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新监区信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateArea(@Valid AreaSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除监区信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteArea(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除监区信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteAreaListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得监区信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 监区信息
|
||||
*/
|
||||
AreaDO getArea(Long id);
|
||||
|
||||
/**
|
||||
* 获得监区信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 监区信息分页
|
||||
*/
|
||||
PageResult<AreaDO> getAreaPage(AreaPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.area;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.area.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.area.AreaDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.area.AreaMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 监区信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class AreaServiceImpl implements AreaService {
|
||||
|
||||
@Resource
|
||||
private AreaMapper areaMapper;
|
||||
|
||||
@Override
|
||||
public Long createArea(AreaSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
AreaDO area = BeanUtils.toBean(createReqVO, AreaDO.class);
|
||||
areaMapper.insert(area);
|
||||
|
||||
// 返回
|
||||
return area.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateArea(AreaSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateAreaExists(updateReqVO.getId());
|
||||
// 更新
|
||||
AreaDO updateObj = BeanUtils.toBean(updateReqVO, AreaDO.class);
|
||||
areaMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteArea(Long id) {
|
||||
// 校验存在
|
||||
validateAreaExists(id);
|
||||
// 删除
|
||||
areaMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAreaListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
areaMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateAreaExists(Long id) {
|
||||
if (areaMapper.selectById(id) == null) {
|
||||
throw exception(AREA_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AreaDO getArea(Long id) {
|
||||
return areaMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<AreaDO> getAreaPage(AreaPageReqVO pageReqVO) {
|
||||
return areaMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.cell;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.cell.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.cell.CellDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 监室信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CellService {
|
||||
|
||||
/**
|
||||
* 创建监室信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCell(@Valid CellSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新监室信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCell(@Valid CellSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除监室信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCell(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除监室信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteCellListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得监室信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 监室信息
|
||||
*/
|
||||
CellDO getCell(Long id);
|
||||
|
||||
/**
|
||||
* 获得监室信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 监室信息分页
|
||||
*/
|
||||
PageResult<CellDO> getCellPage(CellPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.cell;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.cell.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.cell.CellDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.cell.CellMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 监室信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CellServiceImpl implements CellService {
|
||||
|
||||
@Resource
|
||||
private CellMapper cellMapper;
|
||||
|
||||
@Override
|
||||
public Long createCell(CellSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CellDO cell = BeanUtils.toBean(createReqVO, CellDO.class);
|
||||
cellMapper.insert(cell);
|
||||
|
||||
// 返回
|
||||
return cell.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCell(CellSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCellExists(updateReqVO.getId());
|
||||
// 更新
|
||||
CellDO updateObj = BeanUtils.toBean(updateReqVO, CellDO.class);
|
||||
cellMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCell(Long id) {
|
||||
// 校验存在
|
||||
validateCellExists(id);
|
||||
// 删除
|
||||
cellMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCellListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
cellMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateCellExists(Long id) {
|
||||
if (cellMapper.selectById(id) == null) {
|
||||
throw exception(CELL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDO getCell(Long id) {
|
||||
return cellMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CellDO> getCellPage(CellPageReqVO pageReqVO) {
|
||||
return cellMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.consumption;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.consumption.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 消费记录 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ConsumptionService {
|
||||
|
||||
/**
|
||||
* 创建消费记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createConsumption(@Valid ConsumptionSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新消费记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateConsumption(@Valid ConsumptionSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除消费记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteConsumption(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除消费记录
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteConsumptionListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得消费记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 消费记录
|
||||
*/
|
||||
ConsumptionDO getConsumption(Long id);
|
||||
|
||||
/**
|
||||
* 获得消费记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 消费记录分页
|
||||
*/
|
||||
PageResult<ConsumptionDO> getConsumptionPage(ConsumptionPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.consumption;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.consumption.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.consumption.ConsumptionMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 消费记录 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ConsumptionServiceImpl implements ConsumptionService {
|
||||
|
||||
@Resource
|
||||
private ConsumptionMapper consumptionMapper;
|
||||
|
||||
@Override
|
||||
public Long createConsumption(ConsumptionSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ConsumptionDO consumption = BeanUtils.toBean(createReqVO, ConsumptionDO.class);
|
||||
consumptionMapper.insert(consumption);
|
||||
|
||||
// 返回
|
||||
return consumption.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConsumption(ConsumptionSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateConsumptionExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ConsumptionDO updateObj = BeanUtils.toBean(updateReqVO, ConsumptionDO.class);
|
||||
consumptionMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConsumption(Long id) {
|
||||
// 校验存在
|
||||
validateConsumptionExists(id);
|
||||
// 删除
|
||||
consumptionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConsumptionListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
consumptionMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateConsumptionExists(Long id) {
|
||||
if (consumptionMapper.selectById(id) == null) {
|
||||
throw exception(CONSUMPTION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumptionDO getConsumption(Long id) {
|
||||
return consumptionMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ConsumptionDO> getConsumptionPage(ConsumptionPageReqVO pageReqVO) {
|
||||
return consumptionMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
package cn.iocoder.yudao.module.prison.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.convert.prisoner.PrisonerConvert;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO;
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.PrisonerMapper;
|
||||
import cn.iocoder.yudao.module.prison.service.PrisonerService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 服刑人员信息 Service 实现类
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PrisonerServiceImpl implements PrisonerService {
|
||||
|
||||
@Resource
|
||||
private PrisonerMapper prisonerMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createPrisoner(PrisonerSaveReqVO reqVO) {
|
||||
// 检查服刑人员编号是否唯一
|
||||
PrisonerDO existedPrisoner = getPrisonerByNo(reqVO.getPrisonerNo());
|
||||
if (existedPrisoner != null) {
|
||||
throw exception(PRISONER_NO_EXISTS, reqVO.getPrisonerNo());
|
||||
}
|
||||
|
||||
// 插入
|
||||
PrisonerDO prisoner = PrisonerConvert.INSTANCE.convert(reqVO);
|
||||
prisonerMapper.insert(prisoner);
|
||||
return prisoner.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updatePrisoner(PrisonerSaveReqVO reqVO) {
|
||||
// 校验存在
|
||||
PrisonerDO prisoner = getPrisoner(reqVO.getId());
|
||||
if (prisoner == null) {
|
||||
throw exception(PRISONER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 检查服刑人员编号是否唯一(排除自己)
|
||||
PrisonerDO existedPrisoner = getPrisonerByNo(reqVO.getPrisonerNo());
|
||||
if (existedPrisoner != null && !existedPrisoner.getId().equals(reqVO.getId())) {
|
||||
throw exception(PRISONER_NO_EXISTS, reqVO.getPrisonerNo());
|
||||
}
|
||||
|
||||
// 更新
|
||||
PrisonerDO updateObj = PrisonerConvert.INSTANCE.convert(reqVO);
|
||||
prisonerMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deletePrisoner(Long id) {
|
||||
// 校验存在
|
||||
PrisonerDO prisoner = getPrisoner(id);
|
||||
if (prisoner == null) {
|
||||
throw exception(PRISONER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 删除
|
||||
prisonerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deletePrisonerList(List<Long> ids) {
|
||||
// 校验存在
|
||||
List<PrisonerDO> prisoners = prisonerMapper.selectBatchIds(ids);
|
||||
if (CollUtil.isEmpty(prisoners)) {
|
||||
throw exception(PRISONER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 删除
|
||||
prisonerMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrisonerDO getPrisoner(Long id) {
|
||||
return prisonerMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PrisonerDO> getPrisonerPage(PrisonerPageReqVO reqVO) {
|
||||
LambdaQueryWrapper<PrisonerDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(reqVO.getPrisonerNo() != null, PrisonerDO::getPrisonerNo, reqVO.getPrisonerNo())
|
||||
.like(reqVO.getName() != null, PrisonerDO::getName, reqVO.getName())
|
||||
.eq(reqVO.getGender() != null, PrisonerDO::getGender, reqVO.getGender())
|
||||
.eq(reqVO.getIdCard() != null, PrisonerDO::getIdCard, reqVO.getIdCard())
|
||||
.eq(reqVO.getCrime() != null, PrisonerDO::getCrime, reqVO.getCrime())
|
||||
.eq(reqVO.getSupervisionLevel() != null, PrisonerDO::getSupervisionLevel, reqVO.getSupervisionLevel())
|
||||
.eq(reqVO.getRiskLevel() != null, PrisonerDO::getRiskLevel, reqVO.getRiskLevel())
|
||||
.eq(reqVO.getPrisonAreaId() != null, PrisonerDO::getPrisonAreaId, reqVO.getPrisonAreaId())
|
||||
.eq(reqVO.getPrisonCellId() != null, PrisonerDO::getPrisonCellId, reqVO.getPrisonCellId())
|
||||
.eq(reqVO.getStatus() != null, PrisonerDO::getStatus, reqVO.getStatus())
|
||||
.ge(reqVO.getImprisonmentDateStart() != null, PrisonerDO::getImprisonmentDate, reqVO.getImprisonmentDateStart())
|
||||
.le(reqVO.getImprisonmentDateEnd() != null, PrisonerDO::getImprisonmentDate, reqVO.getImprisonmentDateEnd());
|
||||
return prisonerMapper.selectPage(reqVO, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrisonerDO getPrisonerByNo(String prisonerNo) {
|
||||
return prisonerMapper.selectOne(new LambdaQueryWrapper<PrisonerDO>()
|
||||
.eq(PrisonerDO::getPrisonerNo, prisonerNo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.prison.service.question;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.question.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.question.QuestionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 问卷问题 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface QuestionService {
|
||||
|
||||
/**
|
||||
* 创建问卷问题
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createQuestion(@Valid QuestionSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新问卷问题
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateQuestion(@Valid QuestionSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除问卷问题
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteQuestion(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除问卷问题
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteQuestionListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得问卷问题
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 问卷问题
|
||||
*/
|
||||
QuestionDO getQuestion(Long id);
|
||||
|
||||
/**
|
||||
* 获得问卷问题分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 问卷问题分页
|
||||
*/
|
||||
PageResult<QuestionDO> getQuestionPage(QuestionPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 批量更新问卷问题(仅更新排序和分区相关字段)
|
||||
*
|
||||
* @param updateList 更新列表
|
||||
*/
|
||||
void batchUpdateQuestion(List<QuestionSaveReqVO> updateList);
|
||||
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.prison.service.question;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.question.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.question.QuestionDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.question.QuestionMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 问卷问题 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class QuestionServiceImpl implements QuestionService {
|
||||
|
||||
@Resource
|
||||
private QuestionMapper questionMapper;
|
||||
|
||||
@Override
|
||||
public Long createQuestion(QuestionSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
QuestionDO question = BeanUtils.toBean(createReqVO, QuestionDO.class);
|
||||
questionMapper.insert(question);
|
||||
|
||||
// 返回
|
||||
return question.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateQuestion(QuestionSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateQuestionExists(updateReqVO.getId());
|
||||
// 更新
|
||||
QuestionDO updateObj = BeanUtils.toBean(updateReqVO, QuestionDO.class);
|
||||
questionMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestion(Long id) {
|
||||
// 校验存在
|
||||
validateQuestionExists(id);
|
||||
// 删除
|
||||
questionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestionListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
questionMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateQuestionExists(Long id) {
|
||||
if (questionMapper.selectById(id) == null) {
|
||||
throw exception(QUESTION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestionDO getQuestion(Long id) {
|
||||
return questionMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<QuestionDO> getQuestionPage(QuestionPageReqVO pageReqVO) {
|
||||
return questionMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchUpdateQuestion(List<QuestionSaveReqVO> updateList) {
|
||||
if (CollUtil.isEmpty(updateList)) {
|
||||
return;
|
||||
}
|
||||
// 批量更新
|
||||
for (QuestionSaveReqVO updateReqVO : updateList) {
|
||||
// 校验存在
|
||||
validateQuestionExists(updateReqVO.getId());
|
||||
// 更新(仅更新排序和分区相关字段)
|
||||
QuestionDO updateObj = new QuestionDO();
|
||||
updateObj.setId(updateReqVO.getId());
|
||||
updateObj.setPartName(updateReqVO.getPartName());
|
||||
updateObj.setPartSort(updateReqVO.getPartSort());
|
||||
updateObj.setSort(updateReqVO.getSort());
|
||||
questionMapper.updateById(updateObj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.questionnaire;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire.QuestionnaireDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 问卷模板 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface QuestionnaireService {
|
||||
|
||||
/**
|
||||
* 创建问卷模板
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createQuestionnaire(@Valid QuestionnaireSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新问卷模板
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateQuestionnaire(@Valid QuestionnaireSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除问卷模板
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteQuestionnaire(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除问卷模板
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteQuestionnaireListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得问卷模板
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 问卷模板
|
||||
*/
|
||||
QuestionnaireDO getQuestionnaire(Long id);
|
||||
|
||||
/**
|
||||
* 获得问卷模板分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 问卷模板分页
|
||||
*/
|
||||
PageResult<QuestionnaireDO> getQuestionnairePage(QuestionnairePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.questionnaire;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire.QuestionnaireDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.questionnaire.QuestionnaireMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 问卷模板 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class QuestionnaireServiceImpl implements QuestionnaireService {
|
||||
|
||||
@Resource
|
||||
private QuestionnaireMapper questionnaireMapper;
|
||||
|
||||
@Override
|
||||
public Long createQuestionnaire(QuestionnaireSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
QuestionnaireDO questionnaire = BeanUtils.toBean(createReqVO, QuestionnaireDO.class);
|
||||
questionnaireMapper.insert(questionnaire);
|
||||
|
||||
// 返回
|
||||
return questionnaire.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateQuestionnaire(QuestionnaireSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateQuestionnaireExists(updateReqVO.getId());
|
||||
// 更新
|
||||
QuestionnaireDO updateObj = BeanUtils.toBean(updateReqVO, QuestionnaireDO.class);
|
||||
questionnaireMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestionnaire(Long id) {
|
||||
// 校验存在
|
||||
validateQuestionnaireExists(id);
|
||||
// 删除
|
||||
questionnaireMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestionnaireListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
questionnaireMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateQuestionnaireExists(Long id) {
|
||||
if (questionnaireMapper.selectById(id) == null) {
|
||||
throw exception(QUESTIONNAIRE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestionnaireDO getQuestionnaire(Long id) {
|
||||
return questionnaireMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<QuestionnaireDO> getQuestionnairePage(QuestionnairePageReqVO pageReqVO) {
|
||||
return questionnaireMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.questionnairerecord;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord.QuestionnaireRecordDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 问卷答题记录 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface QuestionnaireRecordService {
|
||||
|
||||
/**
|
||||
* 创建问卷答题记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createQuestionnaireRecord(@Valid QuestionnaireRecordSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新问卷答题记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateQuestionnaireRecord(@Valid QuestionnaireRecordSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除问卷答题记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteQuestionnaireRecord(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除问卷答题记录
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteQuestionnaireRecordListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得问卷答题记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 问卷答题记录
|
||||
*/
|
||||
QuestionnaireRecordDO getQuestionnaireRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得问卷答题记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 问卷答题记录分页
|
||||
*/
|
||||
PageResult<QuestionnaireRecordDO> getQuestionnaireRecordPage(QuestionnaireRecordPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.questionnairerecord;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord.QuestionnaireRecordDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.questionnairerecord.QuestionnaireRecordMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 问卷答题记录 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class QuestionnaireRecordServiceImpl implements QuestionnaireRecordService {
|
||||
|
||||
@Resource
|
||||
private QuestionnaireRecordMapper questionnaireRecordMapper;
|
||||
|
||||
@Override
|
||||
public Long createQuestionnaireRecord(QuestionnaireRecordSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
QuestionnaireRecordDO questionnaireRecord = BeanUtils.toBean(createReqVO, QuestionnaireRecordDO.class);
|
||||
questionnaireRecordMapper.insert(questionnaireRecord);
|
||||
|
||||
// 返回
|
||||
return questionnaireRecord.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateQuestionnaireRecord(QuestionnaireRecordSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateQuestionnaireRecordExists(updateReqVO.getId());
|
||||
// 更新
|
||||
QuestionnaireRecordDO updateObj = BeanUtils.toBean(updateReqVO, QuestionnaireRecordDO.class);
|
||||
questionnaireRecordMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestionnaireRecord(Long id) {
|
||||
// 校验存在
|
||||
validateQuestionnaireRecordExists(id);
|
||||
// 删除
|
||||
questionnaireRecordMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteQuestionnaireRecordListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
questionnaireRecordMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateQuestionnaireRecordExists(Long id) {
|
||||
if (questionnaireRecordMapper.selectById(id) == null) {
|
||||
throw exception(QUESTIONNAIRE_RECORD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestionnaireRecordDO getQuestionnaireRecord(Long id) {
|
||||
return questionnaireRecordMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<QuestionnaireRecordDO> getQuestionnaireRecordPage(QuestionnaireRecordPageReqVO pageReqVO) {
|
||||
return questionnaireRecordMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.riskassessment;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment.RiskAssessmentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 危险评估 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface RiskAssessmentService {
|
||||
|
||||
/**
|
||||
* 创建危险评估
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRiskAssessment(@Valid RiskAssessmentSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新危险评估
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRiskAssessment(@Valid RiskAssessmentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除危险评估
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRiskAssessment(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除危险评估
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteRiskAssessmentListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得危险评估
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 危险评估
|
||||
*/
|
||||
RiskAssessmentDO getRiskAssessment(Long id);
|
||||
|
||||
/**
|
||||
* 获得危险评估分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 危险评估分页
|
||||
*/
|
||||
PageResult<RiskAssessmentDO> getRiskAssessmentPage(RiskAssessmentPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.riskassessment;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment.RiskAssessmentDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.riskassessment.RiskAssessmentMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 危险评估 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RiskAssessmentServiceImpl implements RiskAssessmentService {
|
||||
|
||||
@Resource
|
||||
private RiskAssessmentMapper riskAssessmentMapper;
|
||||
|
||||
@Override
|
||||
public Long createRiskAssessment(RiskAssessmentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RiskAssessmentDO riskAssessment = BeanUtils.toBean(createReqVO, RiskAssessmentDO.class);
|
||||
riskAssessmentMapper.insert(riskAssessment);
|
||||
|
||||
// 返回
|
||||
return riskAssessment.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRiskAssessment(RiskAssessmentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRiskAssessmentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RiskAssessmentDO updateObj = BeanUtils.toBean(updateReqVO, RiskAssessmentDO.class);
|
||||
riskAssessmentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRiskAssessment(Long id) {
|
||||
// 校验存在
|
||||
validateRiskAssessmentExists(id);
|
||||
// 删除
|
||||
riskAssessmentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRiskAssessmentListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
riskAssessmentMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateRiskAssessmentExists(Long id) {
|
||||
if (riskAssessmentMapper.selectById(id) == null) {
|
||||
throw exception(RISK_ASSESSMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RiskAssessmentDO getRiskAssessment(Long id) {
|
||||
return riskAssessmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RiskAssessmentDO> getRiskAssessmentPage(RiskAssessmentPageReqVO pageReqVO) {
|
||||
return riskAssessmentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.service.score;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.score.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.score.ScoreDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 计分考核 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ScoreService {
|
||||
|
||||
/**
|
||||
* 创建计分考核
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createScore(@Valid ScoreSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新计分考核
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateScore(@Valid ScoreSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除计分考核
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteScore(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除计分考核
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteScoreListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得计分考核
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 计分考核
|
||||
*/
|
||||
ScoreDO getScore(Long id);
|
||||
|
||||
/**
|
||||
* 获得计分考核分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 计分考核分页
|
||||
*/
|
||||
PageResult<ScoreDO> getScorePage(ScorePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.prison.service.score;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.score.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.score.ScoreDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.dal.mysql.score.ScoreMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.prison.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 计分考核 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ScoreServiceImpl implements ScoreService {
|
||||
|
||||
@Resource
|
||||
private ScoreMapper scoreMapper;
|
||||
|
||||
@Override
|
||||
public Long createScore(ScoreSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ScoreDO score = BeanUtils.toBean(createReqVO, ScoreDO.class);
|
||||
scoreMapper.insert(score);
|
||||
|
||||
// 返回
|
||||
return score.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScore(ScoreSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateScoreExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ScoreDO updateObj = BeanUtils.toBean(updateReqVO, ScoreDO.class);
|
||||
scoreMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteScore(Long id) {
|
||||
// 校验存在
|
||||
validateScoreExists(id);
|
||||
// 删除
|
||||
scoreMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteScoreListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
scoreMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateScoreExists(Long id) {
|
||||
if (scoreMapper.selectById(id) == null) {
|
||||
throw exception(SCORE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScoreDO getScore(Long id) {
|
||||
return scoreMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ScoreDO> getScorePage(ScorePageReqVO pageReqVO) {
|
||||
return scoreMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
11
yudao-module-prison/src/main/resources/application.yaml
Normal file
11
yudao-module-prison/src/main/resources/application.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
server:
|
||||
port: 48080
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: yudao-module-prison
|
||||
|
||||
#芋道配置
|
||||
yudao:
|
||||
prisoner:
|
||||
enabled: true
|
||||
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.prison.dal.mysql.PrisonerMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.prison.dal.dataobject.PrisonerDO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="prisonerNo" column="prisoner_no"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="gender" column="gender"/>
|
||||
<result property="birthday" column="birthday"/>
|
||||
<result property="idCard" column="id_card"/>
|
||||
<result property="ethnicity" column="ethnicity"/>
|
||||
<result property="nativePlace" column="native_place"/>
|
||||
<result property="education" column="education"/>
|
||||
<result property="occupation" column="occupation"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="crime" column="crime"/>
|
||||
<result property="sentenceYears" column="sentence_years"/>
|
||||
<result property="sentenceMonths" column="sentence_months"/>
|
||||
<result property="imprisonmentDate" column="imprisonment_date"/>
|
||||
<result property="releaseDate" column="release_date"/>
|
||||
<result property="supervisionLevel" column="supervision_level"/>
|
||||
<result property="riskLevel" column="risk_level"/>
|
||||
<result property="prisonAreaId" column="prison_area_id"/>
|
||||
<result property="prisonCellId" column="prison_cell_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="creator" column="creator"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updater" column="updater"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="deleted" column="deleted"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
333
yudao-module-prison/src/main/resources/sql/prison_module.sql
Normal file
333
yudao-module-prison/src/main/resources/sql/prison_module.sql
Normal file
@ -0,0 +1,333 @@
|
||||
-- =====================================================
|
||||
-- XL监狱综合管理平台 - 监狱模块数据库脚本
|
||||
-- 生成时间: 2026-01-12
|
||||
-- =====================================================
|
||||
|
||||
-- 注意: 执行前请确保已经创建了 prison 模块的基础表 prison_prisoner
|
||||
-- 此脚本包含 8 个子模块的表结构和菜单权限
|
||||
|
||||
-- =====================================================
|
||||
-- 1. 监区信息表 (prison_area)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_area` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监区ID',
|
||||
`name` varchar(100) NOT NULL COMMENT '监区名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监区编码',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '监区类型:1-普通监区 2-严管监区 3-医院 4-禁闭室',
|
||||
`capacity` int NOT NULL DEFAULT 0 COMMENT '容纳人数',
|
||||
`current_count` int NOT NULL DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int NOT NULL 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`),
|
||||
KEY `idx_prison_area_code` (`code`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='监区信息表';
|
||||
|
||||
-- =====================================================
|
||||
-- 2. 监室信息表 (prison_cell)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_cell` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '监室ID',
|
||||
`area_id` bigint NOT NULL COMMENT '所属监区ID',
|
||||
`name` varchar(100) NOT NULL COMMENT '监室名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '监室编码',
|
||||
`capacity` int NOT NULL DEFAULT 0 COMMENT '床位数量',
|
||||
`current_count` int NOT NULL DEFAULT 0 COMMENT '当前人数',
|
||||
`sort` int NOT NULL 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`),
|
||||
KEY `idx_prison_cell_area_id` (`area_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='监室信息表';
|
||||
|
||||
-- =====================================================
|
||||
-- 3. 消费记录表 (prison_consumption)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_consumption` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '类型:1-存款 2-消费 3-转账',
|
||||
`amount` decimal(10,2) NOT NULL COMMENT '金额',
|
||||
`balance` decimal(10,2) NOT NULL COMMENT '账户余额',
|
||||
`goods_name` varchar(200) DEFAULT NULL COMMENT '商品名称',
|
||||
`goods_count` int DEFAULT 0 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prison_consumption_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_prison_consumption_prisoner_no` (`prisoner_no`),
|
||||
KEY `idx_prison_consumption_trade_time` (`trade_time`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='消费记录表';
|
||||
|
||||
-- =====================================================
|
||||
-- 4. 问卷模板表 (prison_questionnaire)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问卷ID',
|
||||
`title` varchar(200) NOT NULL COMMENT '问卷标题',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '问卷描述',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '问卷类型:1-心理测评 2-风险评估 3-日常调查',
|
||||
`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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prison_questionnaire_status` (`status`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='问卷模板表';
|
||||
|
||||
-- =====================================================
|
||||
-- 5. 问卷问题表 (prison_question)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_question` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '问题ID',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '问卷ID',
|
||||
`title` varchar(500) NOT NULL COMMENT '问题标题',
|
||||
`type` tinyint NOT NULL DEFAULT 1 COMMENT '问题类型:1-单选 2-多选 3-问答 4-评分',
|
||||
`options` text COMMENT '选项,JSON格式:[{ "label": "选项1", "value": "1" }]',
|
||||
`score` int DEFAULT 0 COMMENT '分值',
|
||||
`sort` int NOT NULL 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prison_question_questionnaire_id` (`questionnaire_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='问卷问题表';
|
||||
|
||||
-- =====================================================
|
||||
-- 6. 问卷答题记录表 (prison_questionnaire_record)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_questionnaire_record` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`questionnaire_id` bigint NOT NULL COMMENT '问卷ID',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`answers` text NOT NULL COMMENT '答案,JSON格式',
|
||||
`score` int DEFAULT 0 COMMENT '得分',
|
||||
`result` text COMMENT '评估结果',
|
||||
`status` tinyint NOT NULL DEFAULT 1 COMMENT '状态:1-待评估 2-已完成',
|
||||
`answer_time` datetime NOT NULL COMMENT '答题时间',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0 COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prison_questionnaire_record_questionnaire_id` (`questionnaire_id`),
|
||||
KEY `idx_prison_questionnaire_record_prisoner_id` (`prisoner_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='问卷答题记录表';
|
||||
|
||||
-- =====================================================
|
||||
-- 7. 危险评估表 (prison_risk_assessment)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_risk_assessment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '评估ID',
|
||||
`prisoner_id` bigint NOT NULL COMMENT '罪犯ID',
|
||||
`prisoner_no` varchar(50) NOT NULL COMMENT '罪犯编号',
|
||||
`assessment_type` tinyint NOT NULL DEFAULT 1 COMMENT '评估类型:1-入监评估 2-定期评估 3-出监评估',
|
||||
`risk_level` tinyint NOT NULL COMMENT '风险等级:1-高风险 2-中风险 3-低风险',
|
||||
`risk_score` int DEFAULT 0 COMMENT '风险评分',
|
||||
`factors` text COMMENT '风险因素,JSON格式',
|
||||
`measures` text COMMENT '管控措施',
|
||||
`assessor_id` bigint DEFAULT NULL COMMENT '评估人ID',
|
||||
`assessor_name` varchar(50) DEFAULT NULL COMMENT '评估人姓名',
|
||||
`assessment_date` date NOT NULL COMMENT '评估日期',
|
||||
`next_date` date 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_prison_risk_assessment_prisoner_id` (`prisoner_id`),
|
||||
KEY `idx_prison_risk_assessment_assessment_date` (`assessment_date`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='危险评估表';
|
||||
|
||||
-- =====================================================
|
||||
-- 8. 计分考核表 (prison_score)
|
||||
-- =====================================================
|
||||
CREATE TABLE IF NOT EXISTS `prison_score` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
||||
`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) NOT NULL DEFAULT 0.00 COMMENT '基础分',
|
||||
`reward_score` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '加分',
|
||||
`penalty_score` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '扣分',
|
||||
`total_score` decimal(10,2) NOT NULL 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 '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_prisoner_year_month` (`prisoner_no`, `year`, `month`),
|
||||
KEY `idx_prison_score_prisoner_id` (`prisoner_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='计分考核表';
|
||||
|
||||
-- =====================================================
|
||||
-- 菜单权限 SQL
|
||||
-- 注意: 请将 ${table.parentMenuId} 替换为实际的父菜单ID
|
||||
-- 监狱管理模块的父菜单ID通常为 2000 (系统管理) 或对应的监狱模块菜单ID
|
||||
-- =====================================================
|
||||
|
||||
-- 获取监狱模块父菜单ID (假设为 2000,请根据实际情况调整)
|
||||
-- SELECT @parentId := 2000;
|
||||
|
||||
-- 1. 监区信息管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('监区信息管理', '', 2, 1, 2000, 'area', '', 'prison/area/index', 0, 'Area');
|
||||
SELECT @areaParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监区信息查询', 'prison:area:query', 3, 1, @areaParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监区信息创建', 'prison:area:create', 3, 2, @areaParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监区信息更新', 'prison:area:update', 3, 3, @areaParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监区信息删除', 'prison:area:delete', 3, 4, @areaParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监区信息导出', 'prison:area:export', 3, 5, @areaParentId, '', '', '', 0);
|
||||
|
||||
-- 2. 监室信息管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('监室信息管理', '', 2, 2, 2000, 'cell', '', 'prison/cell/index', 0, 'Cell');
|
||||
SELECT @cellParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监室信息查询', 'prison:cell:query', 3, 1, @cellParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监室信息创建', 'prison:cell:create', 3, 2, @cellParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监室信息更新', 'prison:cell:update', 3, 3, @cellParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监室信息删除', 'prison:cell:delete', 3, 4, @cellParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('监室信息导出', 'prison:cell:export', 3, 5, @cellParentId, '', '', '', 0);
|
||||
|
||||
-- 3. 消费记录管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('消费记录管理', '', 2, 3, 2000, 'consumption', '', 'prison/consumption/index', 0, 'Consumption');
|
||||
SELECT @consumptionParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('消费记录查询', 'prison:consumption:query', 3, 1, @consumptionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('消费记录创建', 'prison:consumption:create', 3, 2, @consumptionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('消费记录更新', 'prison:consumption:update', 3, 3, @consumptionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('消费记录删除', 'prison:consumption:delete', 3, 4, @consumptionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('消费记录导出', 'prison:consumption:export', 3, 5, @consumptionParentId, '', '', '', 0);
|
||||
|
||||
-- 4. 问卷模板管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('问卷模板管理', '', 2, 4, 2000, 'questionnaire', '', 'prison/questionnaire/index', 0, 'Questionnaire');
|
||||
SELECT @questionnaireParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷模板查询', 'prison:questionnaire:query', 3, 1, @questionnaireParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷模板创建', 'prison:questionnaire:create', 3, 2, @questionnaireParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷模板更新', 'prison:questionnaire:update', 3, 3, @questionnaireParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷模板删除', 'prison:questionnaire:delete', 3, 4, @questionnaireParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷模板导出', 'prison:questionnaire:export', 3, 5, @questionnaireParentId, '', '', '', 0);
|
||||
|
||||
-- 5. 问卷问题管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('问卷问题管理', '', 2, 5, 2000, 'question', '', 'prison/question/index', 0, 'Question');
|
||||
SELECT @questionParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷问题查询', 'prison:question:query', 3, 1, @questionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷问题创建', 'prison:question:create', 3, 2, @questionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷问题更新', 'prison:question:update', 3, 3, @questionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷问题删除', 'prison:question:delete', 3, 4, @questionParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷问题导出', 'prison:question:export', 3, 5, @questionParentId, '', '', '', 0);
|
||||
|
||||
-- 6. 问卷答题记录管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('问卷答题记录管理', '', 2, 6, 2000, 'questionnaire-record', '', 'prison/questionnairerecord/index', 0, 'QuestionnaireRecord');
|
||||
SELECT @recordParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷答题记录查询', 'prison:questionnaire-record:query', 3, 1, @recordParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷答题记录创建', 'prison:questionnaire-record:create', 3, 2, @recordParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷答题记录更新', 'prison:questionnaire-record:update', 3, 3, @recordParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷答题记录删除', 'prison:questionnaire-record:delete', 3, 4, @recordParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('问卷答题记录导出', 'prison:questionnaire-record:export', 3, 5, @recordParentId, '', '', '', 0);
|
||||
|
||||
-- 7. 危险评估管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('危险评估管理', '', 2, 7, 2000, 'risk-assessment', '', 'prison/riskassessment/index', 0, 'RiskAssessment');
|
||||
SELECT @riskParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('危险评估查询', 'prison:risk-assessment:query', 3, 1, @riskParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('危险评估创建', 'prison:risk-assessment:create', 3, 2, @riskParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('危险评估更新', 'prison:risk-assessment:update', 3, 3, @riskParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('危险评估删除', 'prison:risk-assessment:delete', 3, 4, @riskParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('危险评估导出', 'prison:risk-assessment:export', 3, 5, @riskParentId, '', '', '', 0);
|
||||
|
||||
-- 8. 计分考核管理菜单
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status, component_name)
|
||||
VALUES ('计分考核管理', '', 2, 8, 2000, 'score', '', 'prison/score/index', 0, 'Score');
|
||||
SELECT @scoreParentId := LAST_INSERT_ID();
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('计分考核查询', 'prison:score:query', 3, 1, @scoreParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('计分考核创建', 'prison:score:create', 3, 2, @scoreParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('计分考核更新', 'prison:score:update', 3, 3, @scoreParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('计分考核删除', 'prison:score:delete', 3, 4, @scoreParentId, '', '', '', 0);
|
||||
INSERT INTO system_menu (name, permission, type, sort, parent_id, path, icon, component, status)
|
||||
VALUES ('计分考核导出', 'prison:score:export', 3, 5, @scoreParentId, '', '', '', 0);
|
||||
1
yudao-module-temp
Submodule
1
yudao-module-temp
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit bf6875adf6a99d90ca95f84a6045aea1cc8779c8
|
||||
@ -115,6 +115,13 @@
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 监狱管理模块 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-prison</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring boot 配置所需依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@ -47,7 +47,7 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://192.168.10.130:3306/xlcp_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
||||
@ -55,8 +55,8 @@ spring:
|
||||
# url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
|
||||
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
|
||||
username: root
|
||||
password: 123456
|
||||
username: xlcp_dev
|
||||
password: xlcp_dev
|
||||
# username: sa # SQL Server 连接的示例
|
||||
# password: Yudao@2024 # SQL Server 连接的示例
|
||||
# username: SYSDBA # DM 连接的示例
|
||||
@ -66,8 +66,8 @@ spring:
|
||||
slave: # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
username: xlcp_dev
|
||||
password: xlcp_dev
|
||||
# tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!)
|
||||
# url: jdbc:TAOS-WS://127.0.0.1:6041/ruoyi_vue_pro
|
||||
# driver-class-name: com.taosdata.jdbc.ws.WebSocketDriver
|
||||
@ -79,10 +79,10 @@ spring:
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: dev # 密码,建议生产环境开启
|
||||
host: 192.168.10.130
|
||||
port: 6379
|
||||
database: 0
|
||||
password: redis_8a8EYH
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
@ -229,6 +229,7 @@ yudao:
|
||||
enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
|
||||
security:
|
||||
mock-enable: true
|
||||
mock-secret: emsoft
|
||||
pay:
|
||||
order-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
|
||||
refund-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user