forked from wangziqi/gongxue-base
- imports: 新增 preflight_import 预检报告(判定/分阶段统计/阻断归因/问题/下一步/错误示例),导入任务 settings 落库(映射/校区/更新/重复/未匹配策略),预览应用策略,向导提交写操作日志 - ai-chat: 新增 excel_analyze(ExcelJS)工具,移除附件/上下文截断,start_import_wizard 支持确认参数,ui.import_preflight SSE,预览确认写操作日志 - admin: ImportPreflightCard 渲染与持久化,聊天抽屉布局/侧边栏修复,考勤页 CSS 引入,费用/学生页接口 schema 校验修复
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Column, CreateDateColumn, Entity, Index, PrimaryColumn, UpdateDateColumn } from 'typeorm';
|
|
import type { ImportRunSource, ImportRunStatus, ImportStepKey } from '../imports.types';
|
|
|
|
@Entity('import_runs')
|
|
@Index('idx_import_runs_user_created', ['userId', 'createdAt'])
|
|
export class ImportRun {
|
|
@PrimaryColumn({ type: 'varchar', length: 36 })
|
|
id: string;
|
|
|
|
@Column({ name: 'user_id', type: 'integer' })
|
|
userId: number;
|
|
|
|
@Column({ name: 'conversation_id', type: 'integer', nullable: true })
|
|
conversationId: number | null;
|
|
|
|
@Column({ type: 'varchar', length: 10, default: 'manual' })
|
|
source: ImportRunSource;
|
|
|
|
@Column({ name: 'file_name', type: 'varchar', length: 255 })
|
|
fileName: string;
|
|
|
|
/** Serialized sheet data — parsed rows are kept here for v1. */
|
|
@Column({ name: 'sheets_json', type: 'text' })
|
|
sheetsJson: string;
|
|
|
|
/** Serialized ImportRunSettings — confirmed mapping/policies from AI preflight. */
|
|
@Column({ name: 'settings_json', type: 'text', nullable: true })
|
|
settingsJson: string | null;
|
|
|
|
@Column({ type: 'varchar', length: 20, default: 'preparing' })
|
|
status: ImportRunStatus;
|
|
|
|
@Column({ name: 'current_step_key', type: 'varchar', length: 20, nullable: true })
|
|
currentStepKey: ImportStepKey | null;
|
|
|
|
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
error: string | null;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at' })
|
|
updatedAt: Date;
|
|
}
|