Merge PR #6: land REV004 price-diff evidence\n\nConstraint: Preserve reviewed PRICE_DIFF_ADJUST evidence without mixing unrelated doc drafts\nConfidence: high\nScope-risk: narrow\nDirective: Keep future price-diff verification updates in follow-up evidence docs or dated append sections\nTested: PR #6 evidence reviewed against backend PR #78 verification outputs\nNot-tested: No doc export/render pipeline executed at merge time

This commit is contained in:
tangweijie 2026-04-17 15:41:02 +08:00
commit c741164fa4

View File

@ -0,0 +1,135 @@
# REV004 price-diff formal-table 已应用到 application-dev 测试库2026-04-17
## 目标库
依据:
- `sw-business/sw-business-server/src/main/resources/application-dev.yaml`
解析结果:
- Host`192.168.10.130`
- Port`5436`
- DB`sw_system`
- User`sw_system`
## 已执行脚本
- `sql/rev004/REV004_price_diff_formal_tables_deploy.sql`
## DDL 执行结果
结果:**PASS**
已确认存在:
- `biz_price_diff_adjust`
- `biz_price_diff_adjust_detail`
- `biz_price_diff_adjust_seq`
- `biz_price_diff_adjust_detail_seq`
已确认幂等重放通过:
- second apply 输出 `already exists, skipping`
- 无重复约束/重复索引异常
## 代码验证
### compile
```bash
mvn -pl sw-business/sw-business-server -DskipTests compile
```
结果:**PASS**
说明:
- 先顺手修复 develop 基线 compile blocker
- `CustApiImpl.java` 去掉 `updateCustPriceTemplateCode` 上多余 `@Override`
- `CustServiceImpl.java` 去掉 `dept.getCode()` 调用
- 之后串行重跑 compile 成功
- 曾出现一次 `NoSuchFileException ... target/generated-sources/...`,确认为 compile 与 test 并行访问同一 `target/` 目录导致的竞态,不属于业务代码错误
### targeted tests
```bash
mvn -pl sw-business/sw-business-server -Dtest=AccountingAdjustActionServiceImplTest,AccountingAdjustProcessServiceImplTest,AccountingAdjustQueryServiceImplTest,PriceDiffFormalizationServiceTest test
```
结果:**PASS**
- Tests run: 43
- Failures: 0
- Errors: 0
## HTTP smokefresh jar, port 48095
### health
- `GET /actuator/health` -> `{"status":"UP"}`
### submit
- `unsold-price-diff-submit` on charge `992205` -> `REV004-992205-20260417153413`
- `unsold-price-diff-submit` on charge `992206` -> `REV004-992206-20260417153414`
- 返回统一为:
- `objectType = PRICE_DIFF_ADJUST`
- `approvalStatus = PENDING_APPROVAL`
- `resultStatus = PENDING_APPROVAL`
- `writeBackStatus = PENDING`
### get / page
- `GET /admin-api/business/accounting-adjust/get?adjustmentNo=REV004-992205-20260417153413`
- 可返回 formal detail
- `priceDiffAmount=15.50`
- `billAmountBefore=100.00`
- `billAmountAfter=115.50`
- `extendedAmountBefore=100.00`
- `extendedAmountAfter=115.50`
- `GET /admin-api/business/accounting-adjust/page?...objectType=PRICE_DIFF_ADJUST`
- 可返回 2 条 fresh smoke formal-first 记录
- `reasonCodeLabel` 已能解析为字典文本(如 `用户协商` / `定价错误`
### approve / reject
- approve`/admin-api/business/accounting-adjust/approve`
- 返回 `APPROVED / SUCCESS / UPDATED`
- reject`/admin-api/business/accounting-adjust/reject`
- 返回 `REJECTED / FAIL / SKIPPED`
## DB 回读
`biz_price_diff_adjust`
- `REV004-992205-20260417153413 -> APPROVED | UPDATED | SUCCESS`
- `REV004-992206-20260417153414 -> REJECTED | SKIPPED | FAIL`
`biz_price_diff_adjust_detail`
- approve 明细:`SUCCESS | APPROVE_EXECUTE | approve price diff smoke`
- reject 明细:`REJECTED | REJECT | reject price diff smoke`
- approve 样例金额前后值:
- `bill_amount_before=100.00 -> bill_amount_after=115.50`
- `extended_amount_before=100.00 -> extended_amount_after=115.50`
`biz_charge`
- `992205 -> bill_amount=115.5000, extended_amount=115.5000, original_money=115.5000`
- `992206 -> bill_amount=80.0000, extended_amount=80.0000, original_money=80.0000`
## 测试数据清理
smoke 完成后已删除:
- `biz_operat_log / detail`identify_value = `992205`, `992206`
- `biz_price_diff_adjust / detail`
- `biz_charge``992205`, `992206`
- `biz_cust``REV004_PD_SMOKE_A`, `REV004_PD_SMOKE_B`
回读结果:
- `pricediff_main_left=0`
- `pricediff_detail_left=0`
- `operat_log_left=0`
- `charge_left=0`
- `cust_left=0`
## 运行态清理
用于 fresh-jar HTTP smoke 的临时实例:
- port `48095`
已停止,当前无残留 LISTEN 进程。
## 当前结论
本轮 price-diff formal-table 已达到:
1. DDL 可落库且可幂等重放;
2. unsold price-diff submit 能落 pending formal main/detail
3. approve/reject 会同步 formal 状态;
4. detail/page 对 `PRICE_DIFF_ADJUST` 已能返回 formal-first 结果;
5. 账单回写与当前 `applyPriceDiffWriteBack(...)` 口径一致;
6. fresh smoke / cleanup 证据完整。
## 当前仍需收口
- 这批尚未提交 commit / PR
- 如果后续要更贴近原系统 `PM_PRICE_RECORDS / DETAILS` 语义,可继续补:
- `PriceListId`
- `PriceCode`
- `IsLadder`
- `NewFeeId`
- 更细颗粒的 old/new late fee 与账单差额字段来源收口。