# Results Overview Card Merge Backend Implementation Plan

> **For agentic workers:** REQUIRED: This repo forbids subagents, so use superpowers:executing-plans in the current session. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** 验证“结果总览卡片结构合并”仅为前端展示层调整，现有结果总览后端接口、字段和查询口径已足以支撑本轮需求，不新增接口、不扩字段、不改 SQL，并补齐后端边界与验证留痕。

**Architecture:** 本轮需求只涉及 `PreliminaryCheck.vue` 顶部结构合并和区块标题统一，后端默认不做源码开发。执行时仅围绕 `CcdiProjectOverviewController + ICcdiProjectOverviewService + CcdiProjectOverviewServiceImpl + CcdiProjectOverviewMapper.xml` 的现有结果总览链路做边界确认与回归验证，确认 `dashboard`、`risk-people`、`risk-models/cards` 与现有风险明细查询数据已能直接支撑新布局；若验证通过，只沉淀“后端无需改造”的实施记录与验证记录。

**Tech Stack:** Java 21, Spring Boot 3, MyBatis XML, Maven, JUnit 5

---

### Task 1: 确认现有结果总览后端契约足以支撑本轮前端合并

**Files:**
- Verify: `ccdi-project/src/main/java/com/ruoyi/ccdi/project/controller/CcdiProjectOverviewController.java`
- Verify: `ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/ICcdiProjectOverviewService.java`
- Verify: `ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/impl/CcdiProjectOverviewServiceImpl.java`
- Verify: `ccdi-project/src/main/resources/mapper/ccdi/project/CcdiProjectOverviewMapper.xml`
- Test: `ccdi-project/src/test/java/com/ruoyi/ccdi/project/controller/CcdiProjectOverviewControllerTest.java`
- Test: `ccdi-project/src/test/java/com/ruoyi/ccdi/project/service/impl/CcdiProjectOverviewServiceImplTest.java`

- [ ] **Step 1: Review the backend boundary**

人工核对以下边界仍成立：

- `GET /ccdi/project/overview/dashboard` 继续提供顶部 5 个统计项数据
- `GET /ccdi/project/overview/risk-people` 继续提供风险人员列表数据
- `GET /ccdi/project/overview/risk-models/cards` 继续提供风险模型卡片数据
- 前端只是把顶部两个区块改为同一卡片展示，不需要新增“风险总览壳层”专用字段
- 现有 `riskLevel`、`riskLevelType`、`modelCount` 等字段语义无需调整

- [ ] **Step 2: Run the focused backend contract tests**

Run:

```bash
mvn test -pl ccdi-project -Dtest=CcdiProjectOverviewControllerTest,CcdiProjectOverviewServiceImplTest
```

Expected:

- `PASS`

- [ ] **Step 3: If any test fails, stop and reassess**

若失败：

- 不要直接新增接口、字段或补丁式查询
- 先确认失败是否与本轮纯前端结构合并直接相关
- 若确实发现后端契约缺口，停止执行并回到设计阶段补充后端方案

- [ ] **Step 4: Re-run the same tests after analysis**

Run:

```bash
mvn test -pl ccdi-project -Dtest=CcdiProjectOverviewControllerTest,CcdiProjectOverviewServiceImplTest
```

Expected:

- `PASS`

- [ ] **Step 5: Commit**

```bash
# 本任务若无代码或文档改动，不产生提交。
```

### Task 2: 做结果总览后端回归并沉淀“无需改造”记录

**Files:**
- Test: `ccdi-project/src/test/java/com/ruoyi/ccdi/project/controller/CcdiProjectOverviewControllerContractTest.java`
- Test: `ccdi-project/src/test/java/com/ruoyi/ccdi/project/mapper/CcdiProjectOverviewMapperSqlTest.java`
- Test: `ccdi-project/src/test/java/com/ruoyi/ccdi/project/mapper/CcdiProjectOverviewMapperRiskModelCardsTest.java`
- Create: `docs/tests/records/2026-03-27-results-overview-card-merge-backend-verification.md`
- Create: `docs/reports/implementation/2026-03-27-results-overview-card-merge-backend-record.md`

- [ ] **Step 1: Run backend regression**

Run:

```bash
mvn test -pl ccdi-project -Dtest=CcdiProjectOverviewControllerContractTest,CcdiProjectOverviewMapperSqlTest,CcdiProjectOverviewMapperRiskModelCardsTest
```

Expected:

- 全部 `PASS`
- 能确认结果总览查询仍基于现有员工结果表与既有 SQL 口径

- [ ] **Step 2: Write the verification record**

在 `docs/tests/records/2026-03-27-results-overview-card-merge-backend-verification.md` 记录：

- 执行命令
- 执行日期
- 测试结果
- 结论：现有结果总览后端契约足以支撑本轮卡片结构合并，后端无需扩展

- [ ] **Step 3: Write the implementation record**

在 `docs/reports/implementation/2026-03-27-results-overview-card-merge-backend-record.md` 记录：

- 本轮后端不改源码
- 维持的接口边界
- 维持的结果总览字段口径
- 回归验证结果

- [ ] **Step 4: Confirm no backend source files were modified**

Run:

```bash
git diff --name-only -- ccdi-project ruoyi-admin ruoyi-common ruoyi-framework ruoyi-system
```

Expected:

- 无输出，或仅出现与当前后端稳定性直接相关且经确认必须修复的文件

- [ ] **Step 5: Commit**

```bash
git add docs/tests/records/2026-03-27-results-overview-card-merge-backend-verification.md docs/reports/implementation/2026-03-27-results-overview-card-merge-backend-record.md
git commit -m "补充结果总览卡片合并后端边界记录"
```

## Done When

- 已确认现有结果总览后端接口足以支撑前端卡片结构合并
- 未引入任何与需求无关的后端补丁式改动
- 已留下后端验证记录与实施记录
- 后端执行结论明确为“无需改造”
