!99 feat(fixcontact): 新增EasyExcel模板导入导出及校验接口

Merge pull request !99 from wsm/feature/20260731
This commit is contained in:
wsm
2026-07-31 01:55:41 +00:00
committed by Gitee
17 changed files with 1193 additions and 0 deletions
@@ -0,0 +1,39 @@
-- 定点联系单菜单权限
-- 前台目录: views/bg/fixcontact/FixedContact20260730List
-- 主菜单
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('178538143865601', NULL, '定点联系单', '/bg/fixcontact/fixedContact20260730List', 'bg/fixcontact/FixedContact20260730List', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0);
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865602', '178538143865601', '添加定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865603', '178538143865601', '编辑定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865604', '178538143865601', '删除定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865605', '178538143865601', '批量删除定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865606', '178538143865601', '导出excel_定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('178538143865607', '178538143865601', '导入excel_定点联系单', NULL, NULL, 0, NULL, NULL, 2, 'bg.fixcontact:fixed_contact_20260730:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-07-30 00:00:00', NULL, NULL, 0, 0, '1', 0);
-- 角色授权(admin角色)
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865608', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865601', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865609', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865602', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865610', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865603', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865611', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865604', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865612', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865605', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865613', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865606', NULL, '2026-07-30 00:00:00', '127.0.0.1');
INSERT INTO sys_role_permission (id, role_id, permission_id, data_rule_ids, operate_date, operate_ip) VALUES ('178538143865614', 'f6817f48af4fb3af11b9e8bf182f618b', '178538143865607', NULL, '2026-07-30 00:00:00', '127.0.0.1');
@@ -0,0 +1,22 @@
DROP PROCEDURE IF EXISTS safe_add_fixcontact_bpm_status;
DELIMITER //
CREATE PROCEDURE safe_add_fixcontact_bpm_status()
BEGIN
DECLARE table_exists INT DEFAULT 0;
DECLARE col_exists INT DEFAULT 0;
SELECT COUNT(*) INTO table_exists FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730';
IF table_exists > 0 THEN
SELECT COUNT(*) INTO col_exists FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730' AND COLUMN_NAME = 'bpm_status';
IF col_exists = 0 THEN
ALTER TABLE fixed_contact_20260730 ADD COLUMN bpm_status varchar(32) DEFAULT NULL COMMENT '流程状态:1=未开始,2=督办中,3=已完成';
END IF;
END IF;
END //
DELIMITER ;
CALL safe_add_fixcontact_bpm_status();
DROP PROCEDURE IF EXISTS safe_add_fixcontact_bpm_status;
@@ -0,0 +1,30 @@
DROP PROCEDURE IF EXISTS safe_add_fixcontact_approval_fields;
DELIMITER //
CREATE PROCEDURE safe_add_fixcontact_approval_fields()
BEGIN
DECLARE table_exists INT DEFAULT 0;
DECLARE col_appro_exists INT DEFAULT 0;
DECLARE col_leader_exists INT DEFAULT 0;
SELECT COUNT(*) INTO table_exists FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730';
IF table_exists > 0 THEN
SELECT COUNT(*) INTO col_appro_exists FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730' AND COLUMN_NAME = 'is_need_appro';
IF col_appro_exists = 0 THEN
ALTER TABLE fixed_contact_20260730 ADD COLUMN is_need_appro varchar(1) DEFAULT '0' COMMENT '是否所办领导审批:0=否,1=是';
END IF;
SELECT COUNT(*) INTO col_leader_exists FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730' AND COLUMN_NAME = 'sup_deptleaderid';
IF col_leader_exists = 0 THEN
ALTER TABLE fixed_contact_20260730 ADD COLUMN sup_deptleaderid varchar(255) DEFAULT NULL COMMENT '所办领导ID,多个逗号分隔';
END IF;
END IF;
END //
DELIMITER ;
CALL safe_add_fixcontact_approval_fields();
DROP PROCEDURE IF EXISTS safe_add_fixcontact_approval_fields;
@@ -0,0 +1,26 @@
DROP PROCEDURE IF EXISTS safe_fix_sup_deptleaderid_column;
DELIMITER //
CREATE PROCEDURE safe_fix_sup_deptleaderid_column()
BEGIN
DECLARE table_exists INT DEFAULT 0;
DECLARE col_wrong_exists INT DEFAULT 0;
DECLARE col_correct_exists INT DEFAULT 0;
SELECT COUNT(*) INTO table_exists FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730';
IF table_exists > 0 THEN
SELECT COUNT(*) INTO col_wrong_exists FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730' AND COLUMN_NAME = 'sup_deptleader_id';
SELECT COUNT(*) INTO col_correct_exists FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fixed_contact_20260730' AND COLUMN_NAME = 'sup_deptleaderid';
IF col_wrong_exists > 0 AND col_correct_exists = 0 THEN
ALTER TABLE fixed_contact_20260730 RENAME COLUMN sup_deptleader_id TO sup_deptleaderid;
END IF;
END IF;
END //
DELIMITER ;
CALL safe_fix_sup_deptleaderid_column();
DROP PROCEDURE IF EXISTS safe_fix_sup_deptleaderid_column;