feat: 经费预算管理
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
-- 年度基础经费与专项经费下拨;原 outlay_allocate_union 历史记录及余额保持不变。
|
||||
-- 人数口径沿用会员统计:本年度 vw_user.member=1,历史年度 member_history.member=1。
|
||||
-- 新表仅记录新流程数据,不自动将历史季度下拨转为年度基础经费,避免重复计入预算。
|
||||
CREATE TABLE IF NOT EXISTS `outlay_annual_base` (
|
||||
`id` varchar(32) NOT NULL,
|
||||
`year` int NOT NULL,
|
||||
`unionId` varchar(32) NOT NULL,
|
||||
`memberCount` int NOT NULL,
|
||||
`standard` decimal(10,2) NOT NULL DEFAULT 800.00,
|
||||
`calculatedMoney` decimal(10,2) NOT NULL,
|
||||
`allocateMoney` decimal(10,2) NOT NULL,
|
||||
`remark` varchar(1000) DEFAULT NULL,
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '0待下拨 1已下拨',
|
||||
`version` int NOT NULL DEFAULT 0,
|
||||
`allocatedAt` bigint DEFAULT NULL,
|
||||
`createdAt` bigint NOT NULL,
|
||||
`createdBy` varchar(32) NOT NULL,
|
||||
`updatedAt` bigint NOT NULL,
|
||||
`updatedBy` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_annual_base_year_union` (`year`,`unionId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='年度基础经费下拨';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `outlay_annual_special` (
|
||||
`id` varchar(32) NOT NULL COMMENT '同时作为提交幂等标识',
|
||||
`year` int NOT NULL,
|
||||
`unionId` varchar(32) NOT NULL,
|
||||
`projectName` varchar(100) NOT NULL,
|
||||
`allocateMoney` decimal(10,2) NOT NULL,
|
||||
`remark` varchar(1000) DEFAULT NULL,
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '0待下拨 1已下拨',
|
||||
`version` int NOT NULL DEFAULT 0,
|
||||
`allocatedAt` bigint DEFAULT NULL,
|
||||
`createdAt` bigint NOT NULL,
|
||||
`createdBy` varchar(32) NOT NULL,
|
||||
`updatedAt` bigint NOT NULL,
|
||||
`updatedBy` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_annual_special_year_union` (`year`,`unionId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专项经费下拨';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `outlay_annual_allocate_log` (
|
||||
`id` varchar(32) NOT NULL,
|
||||
`allocateType` varchar(10) NOT NULL,
|
||||
`allocateId` varchar(32) NOT NULL,
|
||||
`action` varchar(30) NOT NULL,
|
||||
`beforeData` text DEFAULT NULL COMMENT '操作前完整快照',
|
||||
`afterData` text NOT NULL COMMENT '操作后完整快照',
|
||||
`remark` varchar(1000) DEFAULT NULL,
|
||||
`createdAt` bigint NOT NULL,
|
||||
`createdBy` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_annual_log_record_time` (`allocateType`,`allocateId`,`createdAt`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='经费下拨及调整记录';
|
||||
|
||||
-- 沿用现有权限与入口,仅调整菜单名称。
|
||||
UPDATE sys_menu SET name='年度经费下拨', aliasName='年度经费下拨'
|
||||
WHERE permission='outlay.outlayManage.union.allocate';
|
||||
Reference in New Issue
Block a user