8a17369138eb78c3b73313d5bb39465041f49562
Phase 5: Export Feature - Add Excel export API endpoint (GET /tasks/:id/export) - Fix Content-Disposition header encoding for Chinese filenames - Fix export field order to match template definition - Export finalResult or resultA as fallback API Integration Fixes (Phase 1-5): - Fix API response parsing (return result.data consistently) - Fix field name mismatch (fileKey -> sourceFileKey) - Fix Excel parsing bug (range:99 -> slice(0,100)) - Add file upload with Excel parsing (columns, totalRows) - Add detailed error logging for debugging LLM Integration Fixes: - Fix LLM call method: LLMFactory.createLLM -> getAdapter - Fix adapter interface: generateText -> chat([messages]) - Fix response fields: text -> content, tokensUsed -> usage.totalTokens - Fix model names: qwen-max -> qwen3-72b React Infinite Loop Fixes: - Step2: Remove updateState from useEffect deps - Step3: Add useRef to prevent Strict Mode double execution - Step3: Clear interval on API failure (max 3 retries) - Step4: Add useRef to prevent infinite data loading - Add cleanup functions to all useEffect hooks Frontend Enhancements: - Add comprehensive error handling with user-friendly messages - Remove debug console.logs (production ready) - Fix TypeScript type definitions (TaskProgress, ExtractionItem) - Improve Step4Verify data transformation logic Backend Enhancements: - Add detailed logging at each step for debugging - Add parameter validation in controllers - Improve error messages with stack traces (dev mode) - Add export field ordering by template definition Documentation Updates: - Update module status: Tool B MVP completed - Create MVP completion summary (06-开发记录) - Create technical debt document (07-技术债务) - Update API documentation with test status - Update database documentation with verified status - Update system overview with DC module status - Document 4 known issues (Excel preprocessing, progress display, etc.) Testing Results: - File upload: 9 rows parsed successfully - Health check: Column validation working - Dual model extraction: DeepSeek-V3 + Qwen-Max both working - Processing time: ~49s for 9 records (~5s per record) - Token usage: ~10k tokens total (~1.1k per record) - Conflict detection: 1 clean, 8 conflicts (88.9% conflict rate) - Excel export: Working with proper encoding Files Changed: Backend (~500 lines): - ExtractionController.ts: Add upload endpoint, improve logging - DualModelExtractionService.ts: Fix LLM call methods, add detailed logs - HealthCheckService.ts: Fix Excel range parsing - routes/index.ts: Add upload route Frontend (~200 lines): - toolB.ts: Fix API response parsing, add error handling - Step1Upload.tsx: Integrate upload and health check APIs - Step2Schema.tsx: Fix infinite loop, load templates from API - Step3Processing.tsx: Fix infinite loop, integrate progress polling - Step4Verify.tsx: Fix infinite loop, transform backend data correctly - Step5Result.tsx: Integrate export API - index.tsx: Add file metadata to state Scripts: - check-task-progress.mjs: Database inspection utility Docs (~8 files): - 00-模块当前状态与开发指南.md: Update to v2.0 - API设计文档.md: Mark all endpoints as tested - 数据库设计文档.md: Update verification status - DC模块Tool-B开发计划.md: Add MVP completion notice - DC模块Tool-B开发任务清单.md: Update progress to 100% - Tool-B-MVP完成总结.md: New completion summary - Tool-B技术债务清单.md: New technical debt document - 00-系统当前状态与开发指南.md: Update DC module status Status: Tool B MVP complete and production ready
AI科研助手
专注于赋能临床及科研人员的智能化平台
📚 项目文档
📖 文档导航中心
- 📚 完整文档导航 ⭐ 查看所有设计文档和开发规范
🔗 快速链接
- 产品需求文档(PRD) - 了解产品需求
- 技术架构总览 - 了解技术方案
- 数据库设计文档 - 理解数据结构
- API设计规范 - 掌握接口定义
- 开发里程碑 - 查看开发进度
🛠️ 子项目文档
🏗️ 技术栈
前端
- React 18 + TypeScript
- Vite
- TailwindCSS
- Zustand
- LobeChat组件
后端
- Node.js + Fastify + TypeScript
- Prisma ORM
- PostgreSQL
- Redis
第三方服务
- Dify(RAG知识库)
- DeepSeek-V3(主力LLM)
- Qwen3(备用LLM)
✨ 核心功能
1. 智能问答系统
- 基于项目背景的上下文对话
- 支持@知识库引用
- 3种对话模式:RAG快速检索、全文阅读、批处理
2. 知识库管理
- 文档上传与管理(支持PDF/Word/Txt)
- 智能文本提取(Python微服务)
- RAG检索优化(top_k=15, chunk_size=1500)
3. 批处理模式
- 批量提取结构化信息(3-50个文档)
- 预设模板+自定义Prompt
- Excel导出
4. 稿件审查功能 ⭐ 新增
- 双维度智能评估:
- 稿约规范性评估(11个标准)
- 方法学评估(3个部分,20个检查点)
- 完整工作流程:
- Word文档上传(.doc/.docx)
- 实时进度展示
- 详细评估报告
- PDF导出+文本复制
- 多模型支持:DeepSeek-V3 / Qwen3-72B / Qwen-Long
- 独立导航入口:左侧菜单"稿件审查"
5. 12个智能体(规划中)
- ✅ 选题评价智能体(已完成)
- ⏳ 其他11个智能体(计划中)
🚀 快速开始
1. 启动基础服务
# 启动PostgreSQL和Redis
docker-compose up -d
2. 后端开发
cd backend
npm install
npm run dev
3. 前端开发
cd frontend
npm install
npm run dev
📦 目录结构
AIclinicalresearch/
├── frontend/ # 前端项目
├── backend/ # 后端项目
├── docs/ # 项目文档
├── docker-compose.yml # Docker配置
└── README.md # 本文件
🔑 环境变量
请参考 .env.example 文件配置环境变量。
📖 开发指南
请查看 开发里程碑 了解详细的开发计划。
📄 License
MIT
🔗 相关链接
- 📚 文档中心 - 完整的项目文档导航
- ⚙️ 后端项目 - 后端开发指南
- 🎨 前端项目 - 前端开发指南
- 🚀 快速启动指南 - 一步步启动项目
- 🐳 Dify部署方案 - Dify部署指南
当前开发阶段: 里程碑1 - Day 6(前端基础架构)
开发进度: 50% - 前后端基础架构已完成
Description
Languages
TypeScript
83%
Python
6.2%
JavaScript
3.8%
CSS
3.2%
R
2.5%
Other
1.2%