修改保险后端代码,政府前端代码

This commit is contained in:
2025-09-22 17:56:30 +08:00
parent 3143c3ad0b
commit 02a25515a9
206 changed files with 35119 additions and 43073 deletions

View File

@@ -0,0 +1,85 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('reports', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false
},
name: {
type: Sequelize.STRING(255),
allowNull: false,
comment: '报表名称'
},
type: {
type: Sequelize.ENUM('transaction', 'account', 'user'),
allowNull: false,
comment: '报表类型'
},
format: {
type: Sequelize.ENUM('excel', 'pdf', 'csv'),
allowNull: false,
comment: '报表格式'
},
status: {
type: Sequelize.ENUM('processing', 'completed', 'failed'),
allowNull: false,
defaultValue: 'processing',
comment: '报表状态'
},
filePath: {
type: Sequelize.STRING(500),
allowNull: true,
comment: '文件路径'
},
parameters: {
type: Sequelize.JSON,
allowNull: true,
comment: '生成参数'
},
data: {
type: Sequelize.JSON,
allowNull: true,
comment: '报表数据'
},
error: {
type: Sequelize.TEXT,
allowNull: true,
comment: '错误信息'
},
createdBy: {
type: Sequelize.INTEGER,
allowNull: false,
comment: '创建人ID',
references: {
model: 'users',
key: 'id'
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE'
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.NOW
}
});
// 添加索引
await queryInterface.addIndex('reports', ['type', 'status']);
await queryInterface.addIndex('reports', ['createdBy']);
await queryInterface.addIndex('reports', ['createdAt']);
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('reports');
}
};