fundplatform/doc/requirement.sql
zhangjf 5ebbb13a51 fix: 修复API测试中发现的问题
## 问题修复

### 1. 上下文拦截器
- ContextInterceptor: 从HTTP Header提取租户ID和用户ID到ThreadLocal
- WebMvcConfig: 注册拦截器到Spring MVC

### 2. 数据库配置
- fund-cust/application.yml: 修复MySQL密码默认值
- fund-proj/application.yml: 修复MySQL密码默认值

### 3. Gateway配置
- application.yml: 删除空的Sentinel datasource配置
- SentinelRuleConfig: 删除重复的sentinelGatewayFilter Bean

### 4. 数据库表
- requirement.sql: 修复主键列名为id,与BaseEntity保持一致

### 5. MyBatis-Plus依赖
- fund-cust/pom.xml: 使用mybatis-plus-spring-boot3-starter
- fund-proj/pom.xml: 使用mybatis-plus-spring-boot3-starter
2026-02-17 16:12:46 +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` (
`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 (`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='需求工单表';