gz-oarms/task_plan.md

126 lines
4.8 KiB
Markdown
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.

# OARMS 问题修复计划
## 目标
修复 findings.md 中记录的 85 个检查问题P0×17, P1×15, P2×29, P3×24修复后执行端到端测试。
## 修复原则
- **按优先级串行修复**P0 → P1 → P2 → P3
- **跨模块共性问题批量处理**:同一模式一次修完所有模块
- 每个批次修复后编译验证
- 全部修复后启动应用执行端到端测试
## 当前阶段
**状态**: 修复计划已制定,待执行
**当前批次**: —
## 修复批次6 批)
### 批次 1P0 — POST 接口添加 @RequestBody17 处10 个 Controller
所有模块的 POST 接口对象参数添加 `@RequestBody`。简单参数String id, Integer status改为 `@RequestBody Map<String, Object>`
| 文件 | 修改方法 |
|------|---------|
| ScreenController | queryList, save, update, remove, toggleStatus, importData |
| LawClauseController | queryList, save, update, remove, repeal |
| MonitoringRuleController | queryList, save, update, remove, toggleStatus, exportData |
| RecordingConfigController | queryList, save, update, remove, toggleStatus |
| RecordingTaskController | queryList |
| MonitorRecordController | queryList, judgeMonitor |
| EvidenceRecordController | queryList, save |
| EvidenceRuleRelationController | relateRules |
| MonitoringClueController | queryList, generateClue |
| ClueTransferController | queryList, submitTransfer, queryPendingClues, updateTransferStatus, urgeTransfer, withdrawTransfer |
对应 Service 接口和 ServiceImpl 的 remove/toggleStatus 等方法签名也需同步调整。
### 批次 2P1 — save 返回 ID + 业务逻辑修复15 处)
#### 2a. save() 返回新建实体 ID7 个模块)
修改 Service 接口返回值从 `RestResult<?>``RestResult<String>`ServiceImpl 中返回 `entity.getId()`
| 模块 | 方法 |
|------|------|
| BS-1 | ScreenServiceImpl.save() |
| LB-1 | LawClauseServiceImpl.save() |
| MR-1 | MonitoringRuleServiceImpl.save() |
| AM-1 | RecordingConfigServiceImpl.save() |
| CW-1 | EvidenceRecordServiceImpl.save() |
| CW-3 | MonitoringClueServiceImpl.generateClue() |
| CW-4 | ClueTransferServiceImpl.submitTransfer() |
#### 2b. 独立业务逻辑修复
| 模块 | 问题 | 修复 |
|------|------|------|
| LB-1 | repeal() 设 effectiveStatus=0 | 改为 2 |
| CW-3 | statusSummary() 仅统计 1-2 | 补充 3(处理中)、4(已办结) |
### 批次 3P2 — 跨模块通用修复29 处)
#### 3a. Entity 添加 @DS("master")(全部 10 模块,~17 个 Entity
所有 Entity 类添加 `import com.baomidou.dynamic.datasource.annotation.DS;``@DS("master")`
#### 3b. BeanUtils null 覆盖修复5 个模块)
update 方法中,对 req 的 null 字段不覆盖 entity 已有值。改用逐字段 set 或加 null 判断。
| 模块 | 位置 |
|------|------|
| BS-1 | ScreenServiceImpl.update() |
| LB-1 | LawClauseServiceImpl.update() |
| MR-1 | MonitoringRuleServiceImpl.update() |
| AM-1 | RecordingConfigServiceImpl.update() |
| CW-4 | ClueTransferServiceImpl queryListVO 转换) |
#### 3c. 操作人硬编码修复4 个模块)
`UserBaseServiceImpl.getCurrentUser()` 获取当前用户,登录失败时降级为 `"系统管理员"`
| 模块 | 位置 |
|------|------|
| MR-1 | saveOperationHistory() |
| CW-2 | relateRules() — associatedBy |
| CW-3 | generateClue() — generatedBy, saveGenerationLog() |
| CW-4 | submitTransfer() — transferPerson, saveOperationLog() |
#### 3d. 其他 P2 修复
| 模块 | 问题 | 修复 |
|------|------|------|
| BS-1 | VO Date 类型不一致 | ScreenDetailVO 改为 LocalDateTime |
| AM-3 | autoCreateEvidence 异常被吞 | 去掉 try-catch让异常传播 |
| CW-3 | N+1 查询性能 | 批量查询替代循环 selectById |
### 批次 4P3 — 代码规范修复24 处)
#### 4a. Controller 添加 log.info10 个 Controller
所有接口方法入口添加 `log.info("[OK] 操作描述: key={}", value)`
#### 4b. AssertUtils.isNotNull 清理5+ 处)
移除 `AssertUtils.isNotNull(entity, "msg")` 中的 String 参数,改为纯 `AssertUtils.isNotNull(entity)`
#### 4c. 手动拼 JSON 改为工具类MR-1, CW-3
使用 Jackson ObjectMapper 替代 StringBuilder 拼接。
### 批次 5编译验证
```bash
JAVA_HOME="/d/Program Files/Java/jdk-21.0.11+10" \
/d/apache-maven-3.9.15/bin/mvn compile -Pcompany-nexus -Dcheckstyle.skip=true
```
### 批次 6端到端测试
1. 启动应用
2. 按模块逐个测试核心接口query/save/update/remove
3. 重点验证:@RequestBody JSON body 接收、save 返回 ID、repeal 状态值
4. 记录测试结果到 progress.md
## 修复决策
- **P3 IScreenService 返回 RestResult 耦合问题**:暂不修改,改动太大且不影响功能
- **CW-4 部门/人员模拟数据**:保留 TODO不对接真实组织架构
- **CW-1 download/play 占位路径**:保留 TODO不对接文件存储