fujian_water_biz_doc/docs/evidence/rev004-accounting/rev004-split-fixed-fee-first-child-2026-06-19.md

47 lines
2.2 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.

# REV004 分账固定费用归属修复验证记录
## 背景
按水量分账采用连续阶梯重算后,`calculationMode=3` 的固定金额费用会在每个子账单重算一次,导致固定费用被重复收取。
本次明确业务口径:按水量分账时,固定金额费用只归属第 1 个子账单,后续子账单该固定费用为 0。
## 实现范围
- 后端仓库:`../water-backend/`
- 基线:`6156e47f8`
- 验证日期2026-06-19
- 涉及文件:
- `sw-business/sw-business-server/src/main/java/cn/com/emsoft/sw/business/service/accountingadjust/trial/UnsoldTrialPreviewServiceImpl.java`
- `sw-business/sw-business-server/src/main/java/cn/com/emsoft/sw/business/service/accountingadjust/AccountingAdjustActionServiceImpl.java`
- `sw-business/sw-business-server/src/test/java/cn/com/emsoft/sw/business/service/accountingadjust/trial/UnsoldTrialPreviewServiceImplTest.java`
- `sw-business/sw-business-server/src/test/java/cn/com/emsoft/sw/business/service/accountingadjust/AccountingAdjustActionServiceImplTest.java`
## 规则
- 按水量分账继续按拆分顺序做连续阶梯重算。
- 水价费用配置中 `calculationMode=3` 的固定金额费用:
- 第 1 个子账单取原账单对应费用金额。
- 第 2..N 个子账单置 0。
- 正式回写时同步调整子账单费用明细,固定费用明细第 1 个子账单保留原金额,后续子账单清零。
- 按费用组成分账不在本次范围内,保持原逻辑。
## 验证
执行命令:
```bash
mvn -pl sw-business/sw-business-server -am -Dtest=UnsoldTrialPreviewServiceImplTest,AccountingAdjustActionServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false test
```
结果:
- `UnsoldTrialPreviewServiceImplTest`11 tests, 0 failures, 0 errors
- `AccountingAdjustActionServiceImplTest`19 tests, 0 failures, 0 errors
- Reactor buildSUCCESS
补充说明:
- 初次仅使用 `-pl sw-business/sw-business-server` 执行时,因未同时构建 `sw-business-api` 依赖,命中本地依赖中的 `CustPriceChangeUpdateDTO` 缺失编译错误;改用 `-am` 后源码依赖正常参与构建。
- `-am` 执行指定测试时,上游模块需要追加 `-Dsurefire.failIfNoSpecifiedTests=false`,避免上游模块没有匹配测试导致提前失败。