Summary: - Fix methodology score display issue in task list (show score instead of 'warn') - Add methodology_score field to database schema - Fix report display when only methodology agent is selected - Implement Word document export using docx library - Update documentation to v3.0/v3.1 Backend changes: - Add methodologyScore to Prisma schema and TaskSummary type - Update reviewWorker to save methodologyScore - Update getTaskList to return methodologyScore Frontend changes: - Install docx and file-saver libraries - Implement handleExportReport with Word generation - Fix activeTab auto-selection based on available data - Add proper imports for docx components Documentation: - Update RVW module status to 90% (Phase 1-5 complete) - Update system status document to v3.0 Tested: All review workflows verified, Word export functional
85 lines
2.2 KiB
TypeScript
85 lines
2.2 KiB
TypeScript
/**
|
|
* 检查test0102项目是否在数据库中
|
|
*
|
|
* 运行方式:
|
|
* ```bash
|
|
* cd backend
|
|
* npm run tsx src/modules/iit-manager/check-test-project-in-db.ts
|
|
* ```
|
|
*/
|
|
|
|
import { PrismaClient } from '@prisma/client';
|
|
import dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('='.repeat(70));
|
|
console.log('🔍 检查test0102项目在数据库中的配置');
|
|
console.log('='.repeat(70));
|
|
console.log();
|
|
|
|
try {
|
|
// 查询项目
|
|
const project = await prisma.iitProject.findFirst({
|
|
where: {
|
|
redcapProjectId: '16'
|
|
}
|
|
});
|
|
|
|
if (project) {
|
|
console.log('✅ test0102项目已在数据库中');
|
|
console.log();
|
|
console.log('📋 项目信息:');
|
|
console.log(` 数据库ID: ${project.id}`);
|
|
console.log(` 项目名称: ${project.name}`);
|
|
console.log(` REDCap项目ID: ${project.redcapProjectId}`);
|
|
console.log(` REDCap URL: ${project.redcapUrl}`);
|
|
console.log(` API Token: ${project.redcapApiToken.substring(0, 8)}***`);
|
|
console.log(` 状态: ${project.status}`);
|
|
console.log(` 上次同步: ${project.lastSyncAt || '从未同步'}`);
|
|
console.log(` 创建时间: ${project.createdAt}`);
|
|
console.log();
|
|
|
|
console.log('✅ 项目配置完整,可以直接使用!');
|
|
console.log();
|
|
console.log('🚀 下一步:');
|
|
console.log(' 直接运行测试脚本(无需环境变量):');
|
|
console.log(' npm run tsx src/modules/iit-manager/test-redcap-query-from-db.ts');
|
|
} else {
|
|
console.log('❌ test0102项目不在数据库中');
|
|
console.log();
|
|
console.log('📝 需要先将项目添加到数据库');
|
|
console.log();
|
|
console.log('💡 解决方案:');
|
|
console.log(' 运行插入脚本:');
|
|
console.log(' npm run tsx src/modules/iit-manager/insert-test-project.ts');
|
|
}
|
|
|
|
console.log();
|
|
console.log('='.repeat(70));
|
|
|
|
} catch (error: any) {
|
|
console.error('❌ 查询失败:', error.message);
|
|
console.error(' 请检查数据库连接和表结构');
|
|
} finally {
|
|
await prisma.$disconnect();
|
|
}
|
|
}
|
|
|
|
main();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|