From 1d66f0d7f5a056a76553a78852ec2d33eaab498b Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 27 Jan 2026 20:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=90=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:当子任务包含多个任务类型时,updateTaskItemsQuantityAndScore方法 只用第一个任务类型的单价计算总积分,导致积分显示错误。 解决: 1. 先更新typeDetails JSON,再从更新后的typeDetails中重新计算总积分 2. 新增calculateTotalScoreFromTypeDetails方法从JSON中累加所有类型积分 3. 新增calculateTotalQuantityFromTypeDetails方法计算总数量 4. 同时更新平均单价以保持数据一致性 --- CLAUDE.md | 104 +++++++++++++++ .../service/TaskApprovalService.java | 123 +++++++++++++----- 2 files changed, 197 insertions(+), 30 deletions(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..40648ee --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,104 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +DesignHub is a full-stack Designer Task Management Platform (设计师任务抢单管理系统) - a task distribution and management system with a point-based incentive mechanism. + +**Tech Stack:** +- **Frontend**: Vue 3 + TypeScript + Ant Design Vue + Pinia + Vite +- **Backend**: Spring Boot 3.x (Java 17) + MySQL + MyBatis Plus + Redis +- **Authentication**: JWT tokens with RBAC (7 roles) + +## Common Commands + +### Frontend (cd frontend) +```bash +pnpm install # Install dependencies +pnpm dev # Start dev server (port 3000) +pnpm build # Build for production +pnpm lint # Lint and fix code +pnpm format # Format with Prettier +``` + +### Backend (cd backend) +```bash +mvn clean install -DskipTests # Build project +mvn spring-boot:run # Start dev server (port 8080) +java -jar target/designhub-backend-*.jar # Run compiled JAR +``` + +### Database +```bash +mysql -u root -p < database/schema.sql +mysql -u root -p < database/init-data.sql +``` + +## Architecture + +### Backend Structure +``` +backend/src/main/java/com/designhub/ +├── annotation/ # Custom annotations (@RequirePermission, @RequireRole) +├── common/ # Result wrapper, ResultCode enums +├── config/ # Spring configs (Cors, MyBatis, Swagger, Web) +├── controller/ # REST APIs (38 controllers) +├── dto/ # Request DTOs +├── entity/ # JPA entities (53 tables) +├── exception/ # Business exceptions +├── interceptor/ # Auth interceptor +├── mapper/ # MyBatis mappers +├── service/ # Business logic (41 services) +├── util/ # JwtUtil, ExcelExportUtil, etc. +└── vo/ # Response View Objects +``` + +### Frontend Structure +``` +frontend/src/ +├── api/ # Axios API modules (task.ts, user.ts, auth.ts, etc.) +├── components/ # Reusable components (TaskCard, Navbar, etc.) +├── composables/ # Vue composables +├── layouts/ # Layout wrappers +├── router/ # Vue Router config +├── stores/ # Pinia stores (auth, config, siteSettings) +├── types/ # TypeScript interfaces +├── utils/ # Utility functions +└── views/ # Page components (27 views) +``` + +### API Documentation +- Swagger UI: http://localhost:8080/doc.html (when backend running) +- Frontend dev server proxies `/api` to `http://localhost:8080` + +## Key Conventions + +### Backend +- Custom permission annotations: `@RequirePermission`, `@RequireRole` on controller methods +- Response format: `Result` wrapper with `ResultCode` enum for status codes +- JWT tokens stored in `Authorization` header (Bearer scheme) + +### Frontend +- Auto-imported Vue components via `unplugin-vue-components` +- API calls use axios with JWT in localStorage +- Vue Composition API (`