Initial commit: ERP system with advance verification fixes

This commit is contained in:
System Administrator
2026-03-25 23:55:36 +07:00
commit 563ca12d76
5920 changed files with 828689 additions and 0 deletions
@@ -0,0 +1,47 @@
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('company_finance.db');
// 创建执行记录表
db.serialize(() => {
console.log('开始创建执行记录表...');
db.run(`
CREATE TABLE IF NOT EXISTS executions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
apply_id INTEGER NOT NULL,
apply_type TEXT NOT NULL,
action TEXT NOT NULL,
execute_method TEXT,
voucher_no TEXT,
remark TEXT,
reject_reason TEXT,
operator TEXT NOT NULL,
operator_role TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
`, (err) => {
if (err) {
console.error('创建执行记录表失败:', err.message);
} else {
console.log('执行记录表创建成功');
}
});
// 创建索引
db.run(`CREATE INDEX IF NOT EXISTS idx_executions_apply ON executions(apply_id, apply_type)`, (err) => {
if (err) {
console.error('创建索引失败:', err.message);
} else {
console.log('索引创建成功');
}
});
// 关闭数据库连接
db.close((err) => {
if (err) {
console.error('关闭数据库失败:', err.message);
} else {
console.log('数据库连接已关闭');
}
});
});