Capture prestorage strict formal-first evidence for REV004

This records compile/test outputs plus fresh jar smoke proving that
prestorage-process and prestorage-attachments now read formal data first while
retaining fallback behavior.

Constraint: Evidence must stay aligned with the prestorage query-only strict formal-first batch and its application-dev smoke run
Rejected: Fold this note into older prestorage evidence files | reduces traceability for the specific process/attachments closure batch
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Append future prestorage query verification as follow-up evidence rather than overwriting this closure proof
Tested: Cross-checked against backend compile/test output and fresh smoke results on 2026-04-17
Not-tested: No document export/render pipeline executed for this evidence-only commit
This commit is contained in:
tangweijie 2026-04-17 17:20:49 +08:00
parent 89737608b3
commit 21aed1f7d7

View File

@ -0,0 +1,94 @@
# REV004 prestorage process/attachments strict formal-first2026-04-17
## 目标
收口:
- `GET /admin-api/business/accounting-adjust/prestorage-process`
- `GET /admin-api/business/accounting-adjust/prestorage-attachments`
使其优先读取 prestorage formal-table而不是继续主要依赖 legacy/unified fallback。
## 代码变更
核心变更位于:
- `AccountingAdjustProcessServiceImpl`
- `AccountingAdjustProcessServiceImplTest`
策略:
1. `getProcess(adjustmentNo)` 先尝试 `PrestorageFormalizationService.getView(adjustmentNo)`
2. 命中 formal view 时,直接组装 `AccountingAdjustProcessRespVO`
3. `getAttachments(adjustmentNo)` 先尝试读取 formal `attachmentRefs`
4. 仅在 formal 不存在时才回退到 synthetic / unified 口径
## 验证
### compile
```bash
mvn -pl sw-business/sw-business-server -DskipTests compile
```
结果:**PASS**
### targeted tests
```bash
mvn -pl sw-business/sw-business-server -Dtest=AccountingAdjustProcessServiceImplTest,AccountingAdjustPrestorageProcessServiceImplTest test
```
结果:**PASS**
- Tests run: 23
- Failures: 0
- Errors: 0
## fresh jar smokeport 48098
### health
- `GET /actuator/health` -> `{"status":"UP"}`
### smoke 数据
手工 seed
- `adjustmentNo = REV004-PTR-993001-SEED`
- formal main`biz_prestorage_adjust`
- formal detail`biz_prestorage_adjust_detail`
- attachment refs`101,proof-raw`
### process
调用:
- `GET /admin-api/business/accounting-adjust/prestorage-process?adjustmentNo=REV004-PTR-993001-SEED`
结果:**PASS**
返回关键字段:
- `objectType = LEGACY_PRESTORAGE_TRANSFER`
- `adjustType = TRANSFER`
- `actionAmount = 20.0`
- `resultStatus = SUCCESS`
- `approvalStatus = NOT_REQUIRED`
- `writeBackStatus = UPDATED`
- `attachmentRefs = ["101", "proof-raw"]`
- `applicant = 王五`
- `contactMobile = 13700000000`
- `latestMessage = 预存转账成功,目标户号=C-993002`
说明process 已命中 formal main而不是再走 unified detail 兜底。
### attachments
调用:
- `GET /admin-api/business/accounting-adjust/prestorage-attachments?adjustmentNo=REV004-PTR-993001-SEED`
结果:**PASS**
返回:
- ref=`101` -> 数值 ID 解析,当前附件实体不存在,返回 `resolved=false, message=附件不存在`
- ref=`proof-raw` -> 非数值引用,返回 `resolved=false, message=附件引用不是数值ID保留原始引用`
说明attachments 已优先读取 formal `attachmentRefs`,并保留现有解析策略。
## 清理
已删除:
- `biz_prestorage_adjust / detail` seed 数据
回读结果:
- `prestorage_main_left=0`
- `prestorage_detail_left=0`
运行态:
- `48098` 已停止
## 当前结论
本轮 prestorage 剩余查询缺口已完成 strict formal-first 收口:
1. `prestorage-process` 优先命中 formal
2. `prestorage-attachments` 优先命中 formal attachment refs
3. formal 缺失时仍可继续 fallback
4. 主链路 schema / 写路径无变更