refactor: 物业报修模块重构

1. 重命名物业报修相关类,统一添加Hq前缀
2. 更新相关文档和SQL文件
3. 优化前端样式和视图
4. 清理无用的测试文件

Issue #123
This commit is contained in:
zlwu committed 2025-07-09 16:55:24 +08:00
1 parent 90b13a6e0c
commit f969e4ff7d
68 files changed
+1956 -781

No files matched your search

@@ -30,41 +30,41 @@
### 🗂️ 表结构清单
| 表名 | 中文名称 | 用途 | 关联关系 |
| ----------------------- | ---------- | ---------------------- | ------------ |
| `pm_repair_order` | 报修工单表 | 存储报修申请的核心信息 | 核心表 |
| `pm_repair_attachment` | 报修附件表 | 存储报修相关附件文件 | 关联报修工单 |
| `pm_repair_progress` | 维修进度表 | 记录维修过程状态变更 | 关联报修工单 |
| `pm_service_evaluation` | 服务评价表 | 存储用户服务质量评价 | 关联报修工单 |
| `pm_repair_category` | 维修类型表 | 报修类型分类配置 | 字典表 |
| `pm_system_config` | 系统配置表 | 模块系统参数配置 | 配置表 |
| 表名 | 中文名称 | 用途 | 关联关系 |
| --------------------------- | ---------- | ---------------------- | ------------ |
| `hq_pm_repair_order` | 报修工单表 | 存储报修申请的核心信息 | 核心表 |
| `hq_pm_repair_attachment` | 报修附件表 | 存储报修相关附件文件 | 关联报修工单 |
| `hq_pm_repair_progress` | 维修进度表 | 记录维修过程状态变更 | 关联报修工单 |
| `hq_pm_service_evaluation` | 服务评价表 | 存储用户服务质量评价 | 关联报修工单 |
| `hq_pm_repair_category` | 维修类型表 | 报修类型分类配置 | 字典表 |
| `hq_pm_system_config` | 系统配置表 | 模块系统参数配置 | 配置表 |
### 📈 数据流转关系
```mermaid
graph TD
A[用户提交报修] --> B[pm_repair_order 报修工单]
B --> C[pm_repair_attachment 附件]
B --> D[pm_repair_progress 进度]
B --> E[pm_service_evaluation 评价]
F[pm_repair_category 类型] --> B
G[pm_system_config 配置] --> B
A[用户提交报修] --> B[hq_pm_repair_order 报修工单]
B --> C[hq_pm_repair_attachment 附件]
B --> D[hq_pm_repair_progress 进度]
B --> E[hq_pm_service_evaluation 评价]
F[hq_pm_repair_category 类型] --> B
G[hq_pm_system_config 配置] --> B
H[sys_user 系统用户] --> B
H --> D
```
## 🏗️ 详细表结构设计
### 1. 报修工单表 (pm_repair_order)
### 1. 报修工单表 (hq_pm_repair_order)
> **核心业务表**:存储报修申请的所有核心信息,是整个模块的数据中心
```sql
-- ----------------------------
-- Table structure for pm_repair_order
-- Table structure for hq_pm_repair_order
-- ----------------------------
DROP TABLE IF EXISTS `pm_repair_order`;
CREATE TABLE `pm_repair_order` (
DROP TABLE IF EXISTS `hq_pm_repair_order`;
CREATE TABLE `hq_pm_repair_order` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -82,7 +82,7 @@ CREATE TABLE `pm_repair_order` (
`repair_location` varchar(200) NOT NULL COMMENT '报修地点',
-- 分类和紧急程度
`category_id` bigint(20) NOT NULL COMMENT '维修类型ID,关联pm_repair_category.id',
`category_id` bigint(20) NOT NULL COMMENT '维修类型ID,关联hq_pm_repair_category.id',
`priority_level` tinyint(1) NOT NULL DEFAULT 3 COMMENT '紧急程度:1-非常紧急,2-紧急,3-一般,4-不紧急,5-可延后',
`expected_finish_time` datetime DEFAULT NULL COMMENT '期望完成时间',
@@ -138,16 +138,16 @@ CREATE TABLE `pm_repair_order` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='报修工单表';
```
### 2. 报修附件表 (pm_repair_attachment)
### 2. 报修附件表 (hq_pm_repair_attachment)
> **附件管理表**:存储报修过程中上传的图片、视频等多媒体文件信息
```sql
-- ----------------------------
-- Table structure for pm_repair_attachment
-- Table structure for hq_pm_repair_attachment
-- ----------------------------
DROP TABLE IF EXISTS `pm_repair_attachment`;
CREATE TABLE `pm_repair_attachment` (
DROP TABLE IF EXISTS `hq_pm_repair_attachment`;
CREATE TABLE `hq_pm_repair_attachment` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -159,7 +159,7 @@ CREATE TABLE `pm_repair_attachment` (
`deleted` tinyint(1) DEFAULT 0 COMMENT '删除标志(0代表存在 1代表删除)',
-- 关联信息
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联pm_repair_order.id',
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联hq_pm_repair_order.id',
-- 文件信息
`file_name` varchar(200) NOT NULL COMMENT '文件原始名称',
@@ -196,16 +196,16 @@ CREATE TABLE `pm_repair_attachment` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='报修附件表';
```
### 3. 维修进度表 (pm_repair_progress)
### 3. 维修进度表 (hq_pm_repair_progress)
> **进度跟踪表**:记录维修过程中的每一个状态变更和进度更新
```sql
-- ----------------------------
-- Table structure for pm_repair_progress
-- Table structure for hq_pm_repair_progress
-- ----------------------------
DROP TABLE IF EXISTS `pm_repair_progress`;
CREATE TABLE `pm_repair_progress` (
DROP TABLE IF EXISTS `hq_pm_repair_progress`;
CREATE TABLE `hq_pm_repair_progress` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -217,7 +217,7 @@ CREATE TABLE `pm_repair_progress` (
`deleted` tinyint(1) DEFAULT 0 COMMENT '删除标志(0代表存在 1代表删除)',
-- 关联信息
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联pm_repair_order.id',
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联hq_pm_repair_order.id',
-- 进度信息
`progress_type` char(1) NOT NULL COMMENT '进度类型:1-工单分派,2-接收确认,3-到达现场,4-开始维修,5-进度更新,6-完成维修,7-用户评价,8-工单归档,9-其他',
@@ -260,16 +260,16 @@ CREATE TABLE `pm_repair_progress` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='维修进度表';
```
### 4. 服务评价表 (pm_service_evaluation)
### 4. 服务评价表 (hq_pm_service_evaluation)
> **评价反馈表**:存储用户对维修服务的多维度评价和反馈信息
```sql
-- ----------------------------
-- Table structure for pm_service_evaluation
-- Table structure for hq_pm_service_evaluation
-- ----------------------------
DROP TABLE IF EXISTS `pm_service_evaluation`;
CREATE TABLE `pm_service_evaluation` (
DROP TABLE IF EXISTS `hq_pm_service_evaluation`;
CREATE TABLE `hq_pm_service_evaluation` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -281,7 +281,7 @@ CREATE TABLE `pm_service_evaluation` (
`deleted` tinyint(1) DEFAULT 0 COMMENT '删除标志(0代表存在 1代表删除)',
-- 关联信息
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联pm_repair_order.id',
`order_id` bigint(20) NOT NULL COMMENT '报修工单ID,关联hq_pm_repair_order.id',
`evaluator_id` bigint(20) NOT NULL COMMENT '评价人ID,关联sys_user.id',
`evaluator_name` varchar(50) NOT NULL COMMENT '评价人姓名',
`evaluated_worker_id` bigint(20) NOT NULL COMMENT '被评价维修员ID,关联sys_user.id',
@@ -330,16 +330,16 @@ CREATE TABLE `pm_service_evaluation` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务评价表';
```
### 5. 维修类型表 (pm_repair_category)
### 5. 维修类型表 (hq_pm_repair_category)
> **分类字典表**:存储维修类型的分类信息,支持层级结构
```sql
-- ----------------------------
-- Table structure for pm_repair_category
-- Table structure for hq_pm_repair_category
-- ----------------------------
DROP TABLE IF EXISTS `pm_repair_category`;
CREATE TABLE `pm_repair_category` (
DROP TABLE IF EXISTS `hq_pm_repair_category`;
CREATE TABLE `hq_pm_repair_category` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -395,16 +395,16 @@ CREATE TABLE `pm_repair_category` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='维修类型表';
```
### 6. 系统配置表 (pm_system_config)
### 6. 系统配置表 (hq_pm_system_config)
> **配置管理表**:存储物业报修模块的系统参数和配置信息
```sql
-- ----------------------------
-- Table structure for pm_system_config
-- Table structure for hq_pm_system_config
-- ----------------------------
DROP TABLE IF EXISTS `pm_system_config`;
CREATE TABLE `pm_system_config` (
DROP TABLE IF EXISTS `hq_pm_system_config`;
CREATE TABLE `hq_pm_system_config` (
-- 标准基础字段(必须)
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
@@ -510,16 +510,16 @@ CREATE TABLE `pm_system_config` (
```sql
-- 报修工单表的核心查询索引
-- 1. 按状态和时间查询(管理员常用)
CREATE INDEX idx_status_time ON pm_repair_order (order_status, create_time);
CREATE INDEX idx_status_time ON hq_pm_repair_order (order_status, create_time);
-- 2. 按维修员查询其工单(维修员常用)
CREATE INDEX idx_assignee_status ON pm_repair_order (assignee_id, order_status);
CREATE INDEX idx_assignee_status ON hq_pm_repair_order (assignee_id, order_status);
-- 3. 按报修人查询(用户查看自己的工单)
CREATE INDEX idx_reporter_time ON pm_repair_order (reporter_id, create_time);
CREATE INDEX idx_reporter_time ON hq_pm_repair_order (reporter_id, create_time);
-- 4. 按紧急程度和分派时间查询(工单分派)
CREATE INDEX idx_priority_assign ON pm_repair_order (priority_level, assign_time);
CREATE INDEX idx_priority_assign ON hq_pm_repair_order (priority_level, assign_time);
```
### 2. 附件查询索引
@@ -527,10 +527,10 @@ CREATE INDEX idx_priority_assign ON pm_repair_order (priority_level, assign_time
```sql
-- 附件表的查询索引
-- 1. 按工单查询附件(最常用)
CREATE INDEX idx_order_stage ON pm_repair_attachment (order_id, upload_stage);
CREATE INDEX idx_order_stage ON hq_pm_repair_attachment (order_id, upload_stage);
-- 2. 按上传者查询附件
CREATE INDEX idx_uploader_time ON pm_repair_attachment (uploader_id, create_time);
CREATE INDEX idx_uploader_time ON hq_pm_repair_attachment (uploader_id, create_time);
```
### 3. 进度查询索引
@@ -538,24 +538,24 @@ CREATE INDEX idx_uploader_time ON pm_repair_attachment (uploader_id, create_time
```sql
-- 进度表的查询索引
-- 1. 按工单查询进度(时间线显示)
CREATE INDEX idx_order_operation_time ON pm_repair_progress (order_id, operation_time);
CREATE INDEX idx_order_operation_time ON hq_pm_repair_progress (order_id, operation_time);
-- 2. 按操作人查询进度
CREATE INDEX idx_operator_time ON pm_repair_progress (operator_id, operation_time);
CREATE INDEX idx_operator_time ON hq_pm_repair_progress (operator_id, operation_time);
```
## 📊 数据存储预估
### 表数据量预估
| 表名 | 日增长量 | 年数据量 | 存储空间预估 |
| --------------------- | ---------- | ------------ | ------------ |
| pm_repair_order | 50-100 条 | 2-4 万条 | 50-100MB |
| pm_repair_attachment | 200-400 条 | 8-16 万条 | 100-200MB |
| pm_repair_progress | 300-600 条 | 12-24 万条 | 150-300MB |
| pm_service_evaluation | 40-80 条 | 1.6-3.2 万条 | 20-40MB |
| pm_repair_category | 0-5 条 | 100-200 条 | <1MB |
| pm_system_config | 0-2 条 | 50-100 条 | <1MB |
| 表名 | 日增长量 | 年数据量 | 存储空间预估 |
| --------------------------- | ---------- | ------------ | ------------ |
| hq_pm_repair_order | 50-100 条 | 2-4 万条 | 50-100MB |
| hq_pm_repair_attachment | 200-400 条 | 8-16 万条 | 100-200MB |
| hq_pm_repair_progress | 300-600 条 | 12-24 万条 | 150-300MB |
| hq_pm_service_evaluation | 40-80 条 | 1.6-3.2 万条 | 20-40MB |
| hq_pm_repair_category | 0-5 条 | 100-200 条 | <1MB |
| hq_pm_system_config | 0-2 条 | 50-100 条 | <1MB |
### 存储优化建议
@@ -570,7 +570,7 @@ CREATE INDEX idx_operator_time ON pm_repair_progress (operator_id, operation_tim
```sql
-- 插入基础维修类型分类
INSERT INTO `pm_repair_category` (
INSERT INTO `hq_pm_repair_category` (
`id`, `tenant_id`, `category_name`, `category_code`, `category_description`,
`parent_id`, `level_depth`, `required_skills`, `skill_level`,
`estimated_duration`, `icon_url`, `color_code`, `sort_order`, `status`,
@@ -588,7 +588,7 @@ INSERT INTO `pm_repair_category` (
```sql
-- 插入系统配置参数
INSERT INTO `pm_system_config` (
INSERT INTO `hq_pm_system_config` (
`id`, `tenant_id`, `config_key`, `config_value`, `config_type`, `config_group`,
`config_name`, `config_description`, `default_value`, `is_system`, `is_editable`,
`sort_order`, `status`, `create_time`, `create_by`