This evidence snapshot records the application-dev target database, DDL apply and replay status, targeted verification commands, fresh-jar smoke outcomes, and cleanup proof for the writtenoff formal-table batch. Constraint: Evidence must remain aligned with the backend writtenoff formal-table batch and the actual application-dev database Rejected: Fold evidence into unrelated doc updates already present in this branch | would mix scopes and obscure traceability Confidence: high Scope-risk: narrow Reversibility: clean Directive: Update this evidence if later writtenoff smoke is rerun on a different port or with different seeded IDs Tested: Reviewed against backend compile/test results and direct psql cleanup verification on 2026-04-17 Not-tested: No additional doc rendering/export pipeline run for this evidence-only change
3.3 KiB
3.3 KiB
REV004 writtenoff 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_writtenoff_formal_tables_deploy.sql
DDL 执行结果
结果:PASS
已确认存在:
biz_writtenoff_adjustbiz_writtenoff_adjust_detailbiz_writtenoff_adjust_seqbiz_writtenoff_adjust_detail_seq
已确认幂等重放通过:
- second apply 输出
already exists, skipping - 无重复约束/重复索引异常
代码验证
compile
mvn -pl sw-business/sw-business-server -DskipTests compile
结果:PASS
targeted tests
mvn -pl sw-business/sw-business-server \
-Dtest=AccountingAdjustSoldProcessServiceImplTest,AccountingAdjustActionServiceImplTest,AccountingAdjustProcessServiceImplTest,AccountingAdjustQueryServiceImplTest,WrittenoffFormalizationServiceTest test
结果:PASS
- Tests run: 41
- Failures: 0
- Errors: 0
HTTP smoke(fresh jar, port 48093)
submit
sold-submiton charge992005→REV004-SLD-992005-20260417143622sold-submiton charge992006→REV004-SLD-992006-20260417143623- 返回统一为:
objectType = WRITTENOFF_ADJUSTapprovalStatus = PENDING_APPROVALresultStatus = PENDING_APPROVALwriteBackStatus = PENDING
DB 回读
biz_writtenoff_adjust_detail:
- submit 后 detail 进入
PENDING_APPROVAL / SUBMIT
query
GET /admin-api/business/accounting-adjust/get?adjustmentNo=...对 writtenoff 已返回 formal detailGET /admin-api/business/accounting-adjust/page?...objectType=WRITTENOFF_ADJUST已返回 formal-first 列表
approve / reject
- approve:
/admin-api/business/accounting-adjust/approve- 返回
APPROVED/SUCCESS/UPDATED - 账单
extended_amount归零、discount_money累加、pay_state=SETTLED(2)
- 返回
- reject:
/admin-api/business/accounting-adjust/reject- 返回
REJECTED/FAIL/SKIPPED - 账单保持原值,不执行核销回写
- 返回
测试数据清理
smoke 完成后已删除:
biz_operat_log / detail(identify_value =992005,992006)biz_writtenoff_adjust / detailbiz_charge(992005,992006)biz_cust(REV004_WO_SMOKE_A,REV004_WO_SMOKE_B)
回读结果:
writtenoff_main_left=0operat_log_left=0charge_left=0cust_left=0
运行态清理
用于 fresh-jar HTTP smoke 的临时实例:
- port
48093
已停止,当前无残留 LISTEN 进程。
当前结论
本轮 writtenoff formal-table 已达到:
- DDL 可落库且可幂等重放;
- sold submit 能落 pending formal main/detail;
- approve/reject 会同步 formal 状态;
- detail/page 对
WRITTENOFF_ADJUST已能返回 formal-first 结果; - sold submit 已补事务边界,避免 operat_log 与 formal-table 半成功;
- 审批/驳回缺失 formal 主记录时将显式报错,避免静默漏更新。
当前未完成
- writtenoff formal-first 目前仍是最小实现,后续仍可优化 page 查询性能(避免 listAll + getView N+1);
- 若需要更细的 charge_detail 差异映射到 formal 明细,可在后续补强。