feat: 功能优化

This commit is contained in:
2026-03-15 15:36:29 +08:00
parent 29e11056dc
commit 4ab1efbc12
63 changed files with 4175 additions and 170 deletions

View File

@@ -294,3 +294,72 @@ CREATE TABLE `member_user_permission` (
KEY `idx_package_id` (`package_id`) USING BTREE,
KEY `idx_validity_end` (`validity_end`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户权限表';
-- ===============================================
-- 5. 兑换码模块
-- ===============================================
-- ===============================================
-- 5.1 菜单配置(需要在后台手动添加或执行以下 SQL
-- 注意parent_id 需要根据实际情况调整,这里假设 muye 积分管理的 parent_id 为 5000
-- ===============================================
-- 兑换码管理菜单(目录)
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5010, '兑换码管理', '', 2, 10, 5000, 'redeemcode', 'ep:tickets', 'muye/redeemcode/index', 'RedeemCode', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换码查询
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5011, '兑换码查询', 'muye:redeem-code:query', 3, 1, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换码创建
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5012, '兑换码创建', 'muye:redeem-code:create', 3, 2, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换码删除
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5013, '兑换码删除', 'muye:redeem-code:delete', 3, 3, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换码导出
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5014, '兑换码导出', 'muye:redeem-code:export', 3, 4, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换记录菜单
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5020, '兑换记录', '', 2, 11, 5000, 'redeemrecord', 'ep:document', 'muye/redeemrecord/index', 'RedeemRecord', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换记录查询
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5021, '兑换记录查询', 'muye:redeem-record:query', 3, 1, 5020, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
-- 兑换记录导出
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
-- VALUES (5022, '兑换记录导出', 'muye:redeem-record:export', 3, 2, 5020, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0')
-- 兑换码表
CREATE TABLE `muye_redemption_code` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
`code` varchar(32) NOT NULL COMMENT '兑换码',
`type` varchar(20) NOT NULL DEFAULT 'points' COMMENT '类型: points-积分',
`amount` int NOT NULL COMMENT '面额(积分数)',
`price` decimal(10,2) DEFAULT NULL COMMENT '原价金额(元)',
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态: 0-未使用 1-已使用 2-已过期',
`batch_no` varchar(32) DEFAULT NULL COMMENT '批次号',
`batch_remark` varchar(200) DEFAULT NULL COMMENT '批次备注',
`user_id` bigint DEFAULT NULL COMMENT '使用者用户ID',
`used_time` datetime DEFAULT NULL COMMENT '使用时间',
`expire_time` datetime 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 NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_code` (`code`) USING BTREE,
KEY `idx_tenant_id` (`tenant_id`) USING BTREE,
KEY `idx_batch_no` (`batch_no`) USING BTREE,
KEY `idx_status` (`status`) USING BTREE,
KEY `idx_user_id` (`user_id`) USING BTREE,
KEY `idx_expire_time` (`expire_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='兑换码表';