fundplatform/doc/requirement.sql
zhangjf 075525d577 feat: 需求工单管理模块完整实现
## 新增功能

### 需求工单实体层
- Requirement.java: 需求工单实体类
- RequirementMapper.java: MyBatis-Plus Mapper接口
- RequirementDataService.java: 数据访问服务

### 业务层
- RequirementDTO.java: 数据传输对象
- RequirementVO.java: 视图对象
- RequirementService.java: 业务服务实现

### 接口层
- RequirementController.java: REST API接口
  - GET /api/v1/requirement/list - 分页查询
  - GET /api/v1/requirement/{id} - 查询详情
  - POST /api/v1/requirement - 创建需求
  - PUT /api/v1/requirement/{id} - 更新需求
  - DELETE /api/v1/requirement/{id} - 删除需求
  - PUT /api/v1/requirement/{id}/status - 更新状态
  - PUT /api/v1/requirement/{id}/progress - 更新进度

### 数据库
- requirement.sql: 建表SQL脚本
2026-02-17 15:34:40 +08:00

35 lines
2.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 需求工单表
CREATE TABLE IF NOT EXISTS `requirement` (
`requirement_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键需求ID',
`tenant_id` BIGINT NOT NULL COMMENT '租户ID',
`requirement_code` VARCHAR(50) NOT NULL COMMENT '需求编号',
`requirement_name` VARCHAR(200) NOT NULL COMMENT '需求名称',
`description` TEXT COMMENT '需求描述',
`project_id` BIGINT NOT NULL COMMENT '项目ID',
`customer_id` BIGINT NOT NULL COMMENT '客户ID',
`priority` VARCHAR(20) DEFAULT 'normal' COMMENT '优先级high-高normal-中low-低',
`estimated_hours` DECIMAL(8,2) DEFAULT 0.00 COMMENT '预估开发工时(小时)',
`actual_hours` DECIMAL(8,2) DEFAULT 0.00 COMMENT '实际开发工时(小时)',
`planned_start` DATE COMMENT '计划开始日期',
`planned_end` DATE COMMENT '计划结束日期',
`actual_start` DATE COMMENT '实际开始日期',
`actual_end` DATE COMMENT '实际结束日期',
`delivery_date` DATE COMMENT '交付日期',
`receivable_amount` DECIMAL(15,2) DEFAULT 0.00 COMMENT '应收款金额',
`receivable_date` DATE COMMENT '应收款日期',
`status` VARCHAR(20) DEFAULT 'pending' COMMENT '状态pending-待开发developing-开发中delivered-已交付completed-已完成',
`progress` INT DEFAULT 0 COMMENT '开发进度0-100',
`attachment_url` VARCHAR(500) COMMENT '附件URL',
`created_by` BIGINT COMMENT '创建人ID',
`created_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_by` BIGINT COMMENT '更新人ID',
`updated_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT DEFAULT 0 COMMENT '逻辑删除0-未删除1-已删除',
PRIMARY KEY (`requirement_id`),
UNIQUE KEY `uk_tenant_code` (`tenant_id`, `requirement_code`),
INDEX `idx_tenant` (`tenant_id`),
INDEX `idx_project` (`project_id`),
INDEX `idx_customer` (`customer_id`),
INDEX `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='需求工单表';