提交任务

This commit is contained in:
zhangzhe 2026-02-03 15:47:45 +08:00
parent 7562d64ee8
commit 43d2e57d44
3 changed files with 1686 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,263 @@
# Requirements Document
## Introduction
本文档定义了学业邑规划 MiAssessment 管理后台业务模块的需求规格。后台管理系统基于 .NET 10 + SQL Server 2022 技术栈,采用 RPC 风格接口(仅 GET/POST 请求。系统需要在现有的用户、角色、权限、菜单管理基础上扩展7个核心业务模块系统配置管理、内容管理、测评管理、用户管理、订单管理、规划师管理和分销管理。
## Glossary
- **Admin_System**: 后台管理系统,用于管理小程序业务数据
- **Config_Service**: 系统配置服务,管理系统配置项的增删改查
- **Content_Service**: 内容管理服务,管理轮播图和宣传图
- **Assessment_Service**: 测评管理服务,管理测评类型、题库、报告分类和结论
- **User_Service**: 用户管理服务管理C端用户信息和等级
- **Order_Service**: 订单管理服务,管理订单列表、详情和退款
- **Planner_Service**: 规划师管理服务,管理规划师信息和预约记录
- **Distribution_Service**: 分销管理服务,管理邀请码、佣金和提现
- **Operator**: 后台运营人员,具有内容管理、订单管理、用户管理权限
- **Finance_Staff**: 财务人员,具有订单管理、提现审核权限
- **Super_Admin**: 超级管理员,具有全部权限
## Requirements
### Requirement 1: 系统配置管理
**User Story:** As an Operator, I want to manage system configuration items, so that I can dynamically adjust system parameters like assessment prices, commission rates, and customer service information.
#### Acceptance Criteria
1. WHEN an Operator requests the configuration list, THE Config_Service SHALL return all configuration items grouped by ConfigType
2. WHEN an Operator updates a configuration value, THE Config_Service SHALL validate the value format and persist the change
3. WHEN an Operator updates a price configuration, THE Config_Service SHALL validate that the value is a positive decimal number
4. WHEN an Operator updates a commission rate configuration, THE Config_Service SHALL validate that the value is between 0 and 1
5. IF an Operator attempts to update a configuration with an invalid value, THEN THE Config_Service SHALL return a descriptive error message
6. THE Config_Service SHALL support the following configuration types: price, commission, withdraw, contact, agreement, content
7. WHEN a configuration is updated, THE Config_Service SHALL record the UpdateTime automatically
### Requirement 2: 轮播图管理
**User Story:** As an Operator, I want to manage banner images, so that I can control the promotional content displayed on the mini-program homepage.
#### Acceptance Criteria
1. WHEN an Operator requests the banner list, THE Content_Service SHALL return banners sorted by Sort field in descending order
2. WHEN an Operator creates a banner, THE Content_Service SHALL validate that ImageUrl is provided and generate a unique Id
3. WHEN an Operator updates a banner, THE Content_Service SHALL validate the LinkType and corresponding LinkUrl/AppId fields
4. IF LinkType is 1 (internal page) or 2 (external link), THEN THE Content_Service SHALL require LinkUrl to be non-empty
5. IF LinkType is 3 (mini-program), THEN THE Content_Service SHALL require both LinkUrl and AppId to be non-empty
6. WHEN an Operator changes banner status, THE Content_Service SHALL update the Status field (0=disabled, 1=enabled)
7. WHEN an Operator deletes a banner, THE Content_Service SHALL perform soft delete by setting IsDeleted to 1
8. WHEN an Operator reorders banners, THE Content_Service SHALL update the Sort field for affected banners
### Requirement 3: 宣传图管理
**User Story:** As an Operator, I want to manage promotional images, so that I can control the promotional content displayed at different positions in the mini-program.
#### Acceptance Criteria
1. WHEN an Operator requests the promotion list, THE Content_Service SHALL return promotions filtered by Position and sorted by Sort field
2. WHEN an Operator creates a promotion, THE Content_Service SHALL validate that ImageUrl and Position are provided
3. THE Content_Service SHALL support Position values: 1 (homepage bottom), 2 (team page)
4. WHEN an Operator updates a promotion, THE Content_Service SHALL validate the Position value is within allowed range
5. WHEN an Operator changes promotion status, THE Content_Service SHALL update the Status field (0=disabled, 1=enabled)
6. WHEN an Operator deletes a promotion, THE Content_Service SHALL perform soft delete by setting IsDeleted to 1
### Requirement 4: 测评类型管理
**User Story:** As an Operator, I want to manage assessment types, so that I can configure different assessment products with their prices and content.
#### Acceptance Criteria
1. WHEN an Operator requests the assessment type list, THE Assessment_Service SHALL return all assessment types sorted by Sort field
2. WHEN an Operator creates an assessment type, THE Assessment_Service SHALL validate that Name, Code, and Price are provided
3. THE Assessment_Service SHALL ensure Code is unique across all assessment types
4. WHEN an Operator updates an assessment type price, THE Assessment_Service SHALL validate that Price is a positive decimal
5. WHEN an Operator changes assessment type status, THE Assessment_Service SHALL update Status (0=offline, 1=online, 2=coming soon)
6. WHEN an Operator updates IntroContent, THE Assessment_Service SHALL accept rich text or image URL content
7. WHEN an Operator deletes an assessment type, THE Assessment_Service SHALL perform soft delete by setting IsDeleted to 1
### Requirement 5: 题库管理
**User Story:** As an Operator, I want to manage assessment questions, so that I can configure the question content for each assessment type.
#### Acceptance Criteria
1. WHEN an Operator requests the question list, THE Assessment_Service SHALL return questions filtered by AssessmentTypeId and sorted by QuestionNo
2. WHEN an Operator creates a question, THE Assessment_Service SHALL validate that AssessmentTypeId, QuestionNo, and Content are provided
3. THE Assessment_Service SHALL ensure QuestionNo is unique within the same AssessmentTypeId
4. WHEN an Operator updates a question, THE Assessment_Service SHALL validate Content is non-empty
5. WHEN an Operator changes question status, THE Assessment_Service SHALL update Status (0=disabled, 1=enabled)
6. WHEN an Operator deletes a question, THE Assessment_Service SHALL perform soft delete by setting IsDeleted to 1
7. WHEN an Operator imports questions in batch, THE Assessment_Service SHALL validate all questions and return detailed error information for invalid entries
### Requirement 6: 报告分类管理
**User Story:** As an Operator, I want to manage report categories, so that I can configure the scoring dimensions and hierarchical structure for assessment reports.
#### Acceptance Criteria
1. WHEN an Operator requests the category list, THE Assessment_Service SHALL return categories in a hierarchical tree structure
2. WHEN an Operator creates a category, THE Assessment_Service SHALL validate that Name, Code, CategoryType, and ScoreRule are provided
3. THE Assessment_Service SHALL support CategoryType values: 1-8 (八大智能, 个人特质, 细分能力, 先天学习, 学习能力, 大脑类型, 性格类型, 未来能力)
4. THE Assessment_Service SHALL support ScoreRule values: 1 (cumulative 1-10), 2 (binary 0/1)
5. WHEN an Operator creates a sub-category, THE Assessment_Service SHALL validate that ParentId references an existing category
6. WHEN an Operator deletes a category with children, THE Assessment_Service SHALL return an error preventing deletion
### Requirement 7: 题目分类映射管理
**User Story:** As an Operator, I want to manage question-category mappings, so that I can configure which questions contribute to which scoring categories.
#### Acceptance Criteria
1. WHEN an Operator requests mappings for a question, THE Assessment_Service SHALL return all associated categories
2. WHEN an Operator requests mappings for a category, THE Assessment_Service SHALL return all associated questions
3. WHEN an Operator creates a mapping, THE Assessment_Service SHALL validate that both QuestionId and CategoryId exist
4. THE Assessment_Service SHALL ensure each QuestionId-CategoryId pair is unique
5. WHEN an Operator deletes a mapping, THE Assessment_Service SHALL remove the association record
6. WHEN an Operator batch updates mappings for a question, THE Assessment_Service SHALL replace all existing mappings atomically
### Requirement 8: 报告结论管理
**User Story:** As an Operator, I want to manage report conclusions, so that I can configure the textual conclusions displayed for different scoring results.
#### Acceptance Criteria
1. WHEN an Operator requests conclusions for a category, THE Assessment_Service SHALL return all conclusions sorted by ConclusionType
2. WHEN an Operator creates a conclusion, THE Assessment_Service SHALL validate that CategoryId, ConclusionType, and Content are provided
3. THE Assessment_Service SHALL support ConclusionType values: 1 (strongest), 2 (stronger), 3 (weaker), 4 (weakest)
4. WHEN an Operator updates a conclusion, THE Assessment_Service SHALL accept rich text Content
5. WHEN an Operator deletes a conclusion, THE Assessment_Service SHALL perform soft delete by setting IsDeleted to 1
### Requirement 9: C端用户列表管理
**User Story:** As an Operator, I want to view and manage C-end user information, so that I can monitor user activities and manage user accounts.
#### Acceptance Criteria
1. WHEN an Operator requests the user list, THE User_Service SHALL return users with pagination support
2. THE User_Service SHALL support filtering users by: Uid, Phone, Nickname, UserLevel, Status, CreateTime range
3. WHEN an Operator views user details, THE User_Service SHALL return complete user information including balance and income statistics
4. WHEN an Operator changes user status, THE User_Service SHALL update Status (0=disabled, 1=normal)
5. WHEN an Operator changes user level, THE User_Service SHALL update UserLevel (1=normal, 2=partner, 3=channel partner)
6. THE User_Service SHALL display user's parent user information if ParentUserId exists
7. WHEN an Operator exports user list, THE User_Service SHALL generate a downloadable file with selected fields
### Requirement 10: 订单列表管理
**User Story:** As an Operator, I want to view and manage orders, so that I can monitor transactions and handle customer issues.
#### Acceptance Criteria
1. WHEN an Operator requests the order list, THE Order_Service SHALL return orders with pagination support sorted by CreateTime descending
2. THE Order_Service SHALL support filtering orders by: OrderNo, UserId, OrderType, Status, PayType, CreateTime range
3. WHEN an Operator views order details, THE Order_Service SHALL return complete order information including user details and product information
4. THE Order_Service SHALL display OrderType as: 1 (assessment order), 2 (planning order)
5. THE Order_Service SHALL display Status as: 1 (pending payment), 2 (paid), 3 (completed), 4 (refunding), 5 (refunded), 6 (cancelled)
6. WHEN an Operator exports order list, THE Order_Service SHALL generate a downloadable file with selected fields
### Requirement 11: 退款处理
**User Story:** As a Finance_Staff, I want to process refund requests, so that I can handle customer refund applications properly.
#### Acceptance Criteria
1. WHEN a Finance_Staff initiates a refund, THE Order_Service SHALL validate that the order Status is 2 (paid) or 3 (completed)
2. WHEN a Finance_Staff initiates a refund, THE Order_Service SHALL update order Status to 4 (refunding)
3. WHEN a refund is completed, THE Order_Service SHALL update order Status to 5 (refunded) and record RefundTime and RefundAmount
4. IF a refund fails, THEN THE Order_Service SHALL revert order Status and record the error reason
5. WHEN processing a refund for an assessment order, THE Order_Service SHALL check if the assessment has been completed
6. THE Order_Service SHALL record RefundReason for audit purposes
### Requirement 12: 规划师信息管理
**User Story:** As an Operator, I want to manage planner information, so that I can configure the planners available for booking in the mini-program.
#### Acceptance Criteria
1. WHEN an Operator requests the planner list, THE Planner_Service SHALL return planners sorted by Sort field descending
2. WHEN an Operator creates a planner, THE Planner_Service SHALL validate that Name, Avatar, and Price are provided
3. WHEN an Operator updates a planner, THE Planner_Service SHALL validate that Price is a positive decimal
4. WHEN an Operator changes planner status, THE Planner_Service SHALL update Status (0=disabled, 1=enabled)
5. WHEN an Operator deletes a planner, THE Planner_Service SHALL perform soft delete by setting IsDeleted to 1
6. WHEN an Operator reorders planners, THE Planner_Service SHALL update the Sort field for affected planners
### Requirement 13: 预约记录管理
**User Story:** As an Operator, I want to view and manage booking records, so that I can track planner appointments and handle scheduling issues.
#### Acceptance Criteria
1. WHEN an Operator requests the booking list, THE Planner_Service SHALL return bookings with pagination support
2. THE Planner_Service SHALL support filtering bookings by: PlannerId, UserId, BookingDate range, Status
3. WHEN an Operator views booking details, THE Planner_Service SHALL return complete booking information including user and planner details
4. WHEN an Operator changes booking status, THE Planner_Service SHALL update Status (1=pending, 2=confirmed, 3=completed, 4=cancelled)
5. THE Planner_Service SHALL display student grade information and scores based on Grade value
6. WHEN an Operator exports booking list, THE Planner_Service SHALL generate a downloadable file with selected fields
### Requirement 14: 邀请码管理
**User Story:** As an Operator, I want to manage invite codes, so that I can generate and distribute free assessment codes to partners.
#### Acceptance Criteria
1. WHEN an Operator requests the invite code list, THE Distribution_Service SHALL return codes with pagination support
2. THE Distribution_Service SHALL support filtering codes by: Code, BatchNo, AssignUserId, Status
3. WHEN an Operator generates invite codes in batch, THE Distribution_Service SHALL create unique 5-character uppercase letter codes
4. WHEN an Operator generates invite codes, THE Distribution_Service SHALL assign the same BatchNo to all codes in the batch
5. WHEN an Operator assigns codes to a user, THE Distribution_Service SHALL update AssignUserId, AssignTime, and Status to 2 (assigned)
6. THE Distribution_Service SHALL display code usage information: UseUserId, UseOrderId, UseTime when Status is 3 (used)
7. WHEN an Operator exports invite code list, THE Distribution_Service SHALL generate a downloadable file with selected fields
### Requirement 15: 佣金记录管理
**User Story:** As a Finance_Staff, I want to view commission records, so that I can monitor the distribution earnings and verify commission calculations.
#### Acceptance Criteria
1. WHEN a Finance_Staff requests the commission list, THE Distribution_Service SHALL return records with pagination support
2. THE Distribution_Service SHALL support filtering commissions by: UserId, FromUserId, OrderId, Level, Status, CreateTime range
3. WHEN a Finance_Staff views commission details, THE Distribution_Service SHALL return complete information including user and order details
4. THE Distribution_Service SHALL display Level as: 1 (direct subordinate), 2 (indirect subordinate)
5. THE Distribution_Service SHALL display Status as: 1 (pending settlement), 2 (settled)
6. THE Distribution_Service SHALL calculate and display commission statistics: total amount, pending amount, settled amount
7. WHEN a Finance_Staff exports commission list, THE Distribution_Service SHALL generate a downloadable file with selected fields
### Requirement 16: 提现审核管理
**User Story:** As a Finance_Staff, I want to review and process withdrawal requests, so that I can approve or reject user withdrawal applications.
#### Acceptance Criteria
1. WHEN a Finance_Staff requests the withdrawal list, THE Distribution_Service SHALL return records with pagination support sorted by CreateTime descending
2. THE Distribution_Service SHALL support filtering withdrawals by: WithdrawalNo, UserId, Status, CreateTime range
3. WHEN a Finance_Staff views withdrawal details, THE Distribution_Service SHALL return complete information including user balance history
4. WHEN a Finance_Staff approves a withdrawal, THE Distribution_Service SHALL update Status to 2 (processing) and record AuditUserId and AuditTime
5. WHEN a Finance_Staff rejects a withdrawal, THE Distribution_Service SHALL update Status to 4 (cancelled) and record AuditRemark
6. WHEN a withdrawal payment is completed, THE Distribution_Service SHALL update Status to 3 (completed) and record PayTime and PayTransactionId
7. IF a withdrawal payment fails, THEN THE Distribution_Service SHALL revert user balance and record the error reason
8. THE Distribution_Service SHALL display Status as: 1 (pending), 2 (processing), 3 (completed), 4 (cancelled)
### Requirement 17: 数据统计仪表盘
**User Story:** As an Operator, I want to view business statistics on a dashboard, so that I can monitor key business metrics at a glance.
#### Acceptance Criteria
1. WHEN an Operator accesses the dashboard, THE Admin_System SHALL display today's statistics: new users, new orders, revenue
2. THE Admin_System SHALL display cumulative statistics: total users, total orders, total revenue
3. THE Admin_System SHALL display recent trends: user growth chart, order trend chart, revenue trend chart
4. THE Admin_System SHALL support date range selection for trend charts
5. THE Admin_System SHALL display pending items: pending withdrawals count, pending bookings count
6. WHEN statistics data is requested, THE Admin_System SHALL return cached data if available and refresh in background
### Requirement 18: 权限控制
**User Story:** As a Super_Admin, I want to control access to business modules, so that different roles can only access their authorized functions.
#### Acceptance Criteria
1. THE Admin_System SHALL integrate with the existing role-permission system
2. WHEN a user without permission accesses a protected endpoint, THE Admin_System SHALL return 403 Forbidden
3. THE Admin_System SHALL define business permissions for each module: config, content, assessment, user, order, planner, distribution
4. THE Admin_System SHALL support permission granularity: view, create, update, delete for each module
5. WHEN a new business module is added, THE Admin_System SHALL register its permissions in the permission system

View File

@ -0,0 +1,306 @@
# Implementation Plan: Admin Business Modules
## Overview
本实现计划将后台管理系统业务模块分解为可执行的开发任务。基于 .NET 10 + SQL Server 2022 技术栈,在现有 MiAssessment.Admin.Business 项目基础上扩展7个核心业务模块。
## Tasks
- [ ] 1. 项目基础设施搭建
- [ ] 1.1 创建业务实体类 (Entities)
- 在 MiAssessment.Admin.Business/Entities 目录下创建所有业务实体类
- 包括: Config, Banner, Promotion, AssessmentType, Question, ReportCategory, QuestionCategoryMapping, ReportConclusion, User, Order, Planner, PlannerBooking, InviteCode, Commission, Withdrawal
- 每个实体类映射到对应的数据库表
- _Requirements: 1.1-1.7, 2.1-2.8, 3.1-3.6, 4.1-4.7, 5.1-5.7, 6.1-6.6, 7.1-7.6, 8.1-8.5, 9.1-9.7, 10.1-10.6, 11.1-11.6, 12.1-12.6, 13.1-13.6, 14.1-14.7, 15.1-15.7, 16.1-16.8_
- [ ] 1.2 扩展 AdminBusinessDbContext
- 在 AdminBusinessDbContext 中添加所有业务实体的 DbSet
- 配置实体映射和索引
- _Requirements: 所有模块_
- [ ] 1.3 创建通用模型和基础类
- 创建 PagedRequest, PagedResult, ApiResponse, UpdateStatusRequest, UpdateSortRequest 等通用模型
- 创建 ErrorCodes 错误码常量类
- 创建 BusinessException 业务异常类
- _Requirements: 所有模块_
- [ ] 2. 系统配置管理模块
- [ ] 2.1 实现 ConfigService
- 创建 IConfigService 接口和 ConfigService 实现
- 实现 GetConfigListAsync, GetConfigByKeyAsync, UpdateConfigAsync, ValidateConfigValueAsync 方法
- 实现配置值验证逻辑(价格、佣金比例)
- _Requirements: 1.1, 1.2, 1.3, 1.4, 1.5, 1.7_
- [ ] 2.2 编写 ConfigService 属性测试
- **Property 6: Config Value Validation**
- **Property 17: Config Update Timestamp**
- **Validates: Requirements 1.3, 1.4, 1.7**
- [ ] 2.3 实现 ConfigController
- 创建 ConfigController 控制器
- 实现 GetList, Update, GetByKey 接口
- _Requirements: 1.1-1.7_
- [ ] 3. 内容管理模块 - 轮播图
- [ ] 3.1 实现 ContentService - Banner 部分
- 创建 IContentService 接口和 ContentService 实现
- 实现 Banner 相关方法: GetBannerListAsync, CreateBannerAsync, UpdateBannerAsync, DeleteBannerAsync, UpdateBannerStatusAsync, UpdateBannerSortAsync
- 实现 LinkType 验证逻辑
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8_
- [ ] 3.2 编写 Banner 属性测试
- **Property 1: Soft Delete Behavior**
- **Property 4: Sorting Correctness**
- **Property 7: Banner Link Type Validation**
- **Validates: Requirements 2.1, 2.3, 2.4, 2.5, 2.7**
- [ ] 3.3 实现 ContentController - Banner 部分
- 创建 ContentController 控制器
- 实现 Banner 相关接口: banner/getList, banner/create, banner/update, banner/delete, banner/updateStatus, banner/updateSort
- _Requirements: 2.1-2.8_
- [ ] 4. 内容管理模块 - 宣传图
- [ ] 4.1 实现 ContentService - Promotion 部分
- 扩展 ContentService 实现 Promotion 相关方法
- 实现 GetPromotionListAsync, CreatePromotionAsync, UpdatePromotionAsync, DeletePromotionAsync, UpdatePromotionStatusAsync
- _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5, 3.6_
- [ ] 4.2 编写 Promotion 属性测试
- **Property 2: Status Update Persistence**
- **Validates: Requirements 3.5**
- [ ] 4.3 实现 ContentController - Promotion 部分
- 扩展 ContentController 实现 Promotion 相关接口
- 实现 promotion/getList, promotion/create, promotion/update, promotion/delete, promotion/updateStatus
- _Requirements: 3.1-3.6_
- [ ] 5. Checkpoint - 内容管理模块完成
- Ensure all tests pass, ask the user if questions arise.
- [ ] 6. 测评管理模块 - 测评类型
- [ ] 6.1 实现 AssessmentService - Type 部分
- 创建 IAssessmentService 接口和 AssessmentService 实现
- 实现 GetTypeListAsync, CreateTypeAsync, UpdateTypeAsync, DeleteTypeAsync
- 实现 Code 唯一性验证
- _Requirements: 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7_
- [ ] 6.2 编写 AssessmentType 属性测试
- **Property 8: Unique Constraint Enforcement (Code)**
- **Validates: Requirements 4.3**
- [ ] 6.3 实现 AssessmentController - Type 部分
- 创建 AssessmentController 控制器
- 实现 type/getList, type/create, type/update, type/delete 接口
- _Requirements: 4.1-4.7_
- [ ] 7. 测评管理模块 - 题库
- [ ] 7.1 实现 AssessmentService - Question 部分
- 扩展 AssessmentService 实现 Question 相关方法
- 实现 GetQuestionListAsync, CreateQuestionAsync, UpdateQuestionAsync, DeleteQuestionAsync, BatchImportQuestionsAsync
- 实现 QuestionNo 唯一性验证(同一 AssessmentTypeId 内)
- _Requirements: 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7_
- [ ] 7.2 编写 Question 属性测试
- **Property 5: Required Field Validation**
- **Property 8: Unique Constraint Enforcement (QuestionNo)**
- **Validates: Requirements 5.2, 5.3**
- [ ] 7.3 实现 AssessmentController - Question 部分
- 扩展 AssessmentController 实现 Question 相关接口
- 实现 question/getList, question/create, question/update, question/delete, question/batchImport
- _Requirements: 5.1-5.7_
- [ ] 8. 测评管理模块 - 报告分类
- [ ] 8.1 实现 AssessmentService - Category 部分
- 扩展 AssessmentService 实现 Category 相关方法
- 实现 GetCategoryTreeAsync, CreateCategoryAsync, UpdateCategoryAsync, DeleteCategoryAsync
- 实现树形结构构建和删除约束检查
- _Requirements: 6.1, 6.2, 6.3, 6.4, 6.5, 6.6_
- [ ] 8.2 编写 Category 属性测试
- **Property 9: Tree Structure Correctness**
- **Property 18: Category Deletion Constraint**
- **Validates: Requirements 6.1, 6.5, 6.6**
- [ ] 8.3 实现 AssessmentController - Category 部分
- 扩展 AssessmentController 实现 Category 相关接口
- 实现 category/getTree, category/create, category/update, category/delete
- _Requirements: 6.1-6.6_
- [ ] 9. 测评管理模块 - 题目分类映射
- [ ] 9.1 实现 AssessmentService - Mapping 部分
- 扩展 AssessmentService 实现 Mapping 相关方法
- 实现 GetMappingsByQuestionAsync, GetMappingsByCategoryAsync, BatchUpdateMappingsAsync
- 实现原子性批量更新
- _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5, 7.6_
- [ ] 9.2 编写 Mapping 属性测试
- **Property 10: Mapping Relationship Bidirectionality**
- **Property 11: Batch Operation Atomicity**
- **Validates: Requirements 7.1, 7.2, 7.6**
- [ ] 9.3 实现 AssessmentController - Mapping 部分
- 扩展 AssessmentController 实现 Mapping 相关接口
- 实现 mapping/getByQuestion, mapping/getByCategory, mapping/batchUpdate
- _Requirements: 7.1-7.6_
- [ ] 10. 测评管理模块 - 报告结论
- [ ] 10.1 实现 AssessmentService - Conclusion 部分
- 扩展 AssessmentService 实现 Conclusion 相关方法
- 实现 GetConclusionListAsync, CreateConclusionAsync, UpdateConclusionAsync, DeleteConclusionAsync
- _Requirements: 8.1, 8.2, 8.3, 8.4, 8.5_
- [ ] 10.2 实现 AssessmentController - Conclusion 部分
- 扩展 AssessmentController 实现 Conclusion 相关接口
- 实现 conclusion/getList, conclusion/create, conclusion/update, conclusion/delete
- _Requirements: 8.1-8.5_
- [ ] 11. Checkpoint - 测评管理模块完成
- Ensure all tests pass, ask the user if questions arise.
- [ ] 12. 用户管理模块
- [ ] 12.1 实现 UserBusinessService
- 扩展现有 UserBusinessService
- 实现 GetUserListAsync, GetUserDetailAsync, UpdateUserStatusAsync, UpdateUserLevelAsync, ExportUsersAsync
- 实现多条件筛选和分页
- _Requirements: 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7_
- [ ] 12.2 编写 User 属性测试
- **Property 3: Pagination Correctness**
- **Validates: Requirements 9.1**
- [ ] 12.3 实现 UserController
- 扩展现有 UserController
- 实现 getList, getDetail, updateStatus, updateLevel, export 接口
- _Requirements: 9.1-9.7_
- [ ] 13. 订单管理模块
- [ ] 13.1 实现 OrderService
- 创建 IOrderService 接口和 OrderService 实现
- 实现 GetOrderListAsync, GetOrderDetailAsync, RefundAsync
- 实现退款状态流转和验证逻辑
- _Requirements: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6_
- [ ] 13.2 编写 Order 属性测试
- **Property 12: Refund Status Transitions**
- **Validates: Requirements 11.1, 11.2, 11.3, 11.4**
- [ ] 13.3 实现 OrderController
- 创建 OrderController 控制器
- 实现 getList, getDetail, refund, export 接口
- _Requirements: 10.1-10.6, 11.1-11.6_
- [ ] 14. Checkpoint - 用户和订单模块完成
- Ensure all tests pass, ask the user if questions arise.
- [ ] 15. 规划师管理模块
- [ ] 15.1 实现 PlannerService
- 创建 IPlannerService 接口和 PlannerService 实现
- 实现 Planner 相关方法: GetPlannerListAsync, CreatePlannerAsync, UpdatePlannerAsync, DeletePlannerAsync, UpdatePlannerStatusAsync, UpdatePlannerSortAsync
- 实现 Booking 相关方法: GetBookingListAsync, GetBookingDetailAsync, UpdateBookingStatusAsync
- _Requirements: 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6_
- [ ] 15.2 实现 PlannerController
- 创建 PlannerController 控制器
- 实现 Planner 接口: getList, create, update, delete, updateStatus, updateSort
- 实现 Booking 接口: booking/getList, booking/getDetail, booking/updateStatus, booking/export
- _Requirements: 12.1-12.6, 13.1-13.6_
- [ ] 16. 分销管理模块 - 邀请码
- [ ] 16.1 实现 DistributionService - InviteCode 部分
- 创建 IDistributionService 接口和 DistributionService 实现
- 实现 GetInviteCodeListAsync, GenerateInviteCodesAsync, AssignInviteCodesAsync
- 实现唯一邀请码生成算法5位大写字母
- _Requirements: 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7_
- [ ] 16.2 编写 InviteCode 属性测试
- **Property 13: Invite Code Generation Uniqueness**
- **Validates: Requirements 14.3, 14.4**
- [ ] 16.3 实现 DistributionController - InviteCode 部分
- 创建 DistributionController 控制器
- 实现 inviteCode/getList, inviteCode/generate, inviteCode/assign, inviteCode/export
- _Requirements: 14.1-14.7_
- [ ] 17. 分销管理模块 - 佣金记录
- [ ] 17.1 实现 DistributionService - Commission 部分
- 扩展 DistributionService 实现 Commission 相关方法
- 实现 GetCommissionListAsync, GetCommissionDetailAsync, GetCommissionStatisticsAsync
- 实现佣金统计计算
- _Requirements: 15.1, 15.2, 15.3, 15.4, 15.5, 15.6, 15.7_
- [ ] 17.2 编写 Commission 属性测试
- **Property 14: Commission Statistics Accuracy**
- **Validates: Requirements 15.6**
- [ ] 17.3 实现 DistributionController - Commission 部分
- 扩展 DistributionController 实现 Commission 相关接口
- 实现 commission/getList, commission/getDetail, commission/getStatistics, commission/export
- _Requirements: 15.1-15.7_
- [ ] 18. 分销管理模块 - 提现审核
- [ ] 18.1 实现 DistributionService - Withdrawal 部分
- 扩展 DistributionService 实现 Withdrawal 相关方法
- 实现 GetWithdrawalListAsync, GetWithdrawalDetailAsync, ApproveWithdrawalAsync, RejectWithdrawalAsync, CompleteWithdrawalAsync
- 实现提现状态流转和余额回滚逻辑
- _Requirements: 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, 16.7, 16.8_
- [ ] 18.2 编写 Withdrawal 属性测试
- **Property 15: Withdrawal Status Transitions**
- **Validates: Requirements 16.4, 16.5, 16.6, 16.7**
- [ ] 18.3 实现 DistributionController - Withdrawal 部分
- 扩展 DistributionController 实现 Withdrawal 相关接口
- 实现 withdrawal/getList, withdrawal/getDetail, withdrawal/approve, withdrawal/reject, withdrawal/complete, withdrawal/export
- _Requirements: 16.1-16.8_
- [ ] 19. Checkpoint - 分销管理模块完成
- Ensure all tests pass, ask the user if questions arise.
- [ ] 20. 数据统计仪表盘模块
- [ ] 20.1 实现 DashboardService
- 扩展现有 DashboardService
- 实现 GetOverviewAsync, GetTrendsAsync, GetPendingItemsAsync
- 实现统计数据计算和趋势数据生成
- _Requirements: 17.1, 17.2, 17.3, 17.4, 17.5_
- [ ] 20.2 实现 DashboardController
- 扩展现有 DashboardController
- 实现 getOverview, getTrends, getPendingItems 接口
- _Requirements: 17.1-17.5_
- [ ] 21. 权限控制集成
- [ ] 21.1 定义业务模块权限
- 在权限系统中注册业务模块权限
- 定义权限: config, content, assessment, user, order, planner, distribution
- 定义权限粒度: view, create, update, delete
- _Requirements: 18.3, 18.4, 18.5_
- [ ] 21.2 编写权限控制属性测试
- **Property 16: Authorization Enforcement**
- **Validates: Requirements 18.2**
- [ ] 21.3 应用权限控制到所有控制器
- 在所有业务控制器方法上添加 [RequirePermission] 特性
- 配置权限检查中间件
- _Requirements: 18.1, 18.2_
- [ ] 22. 服务注册和依赖注入配置
- [ ] 22.1 配置服务注册
- 在 ServiceCollectionExtensions 中注册所有业务服务
- 配置 AutoMapper 映射
- 配置 FluentValidation 验证器
- _Requirements: 所有模块_
- [ ] 23. Final Checkpoint - 全部模块完成
- Ensure all tests pass, ask the user if questions arise.
## Notes
- All tasks are required for comprehensive testing
- Each task references specific requirements for traceability
- Checkpoints ensure incremental validation
- Property tests validate universal correctness properties
- Unit tests validate specific examples and edge cases
- 所有接口采用 RPC 风格,仅使用 GET 和 POST 请求
- 实体类需要与现有数据库表结构保持一致