fujian_water_biz_doc/docs/evidence/rev004-accounting/rev004-latefee-legacy-structure-gap-summary-2026-04-14.md
tangweijie 3eccab2cf9 docs: 文档治理统一 — AGENTS.md 生命周期规则 + 模块归档 + DDL 修正
1. AGENTS.md 更新
   - water-docs: 新增 specs/ 与 docs/design/ 生命周期规则章节
   - water-backend: 更新协作引用(建设期/建成后、evidence 模块化)

2. specs/ 重复合并
   - 006-reminder-event-design 合并入 003-rev006-reminder-event-design
   - 001-rev004-accounting 删除冗余 data-model.md + contracts/
   - 002-rev005-invoice-flow 删除冗余 data-model.md + contracts/

3. evidence 按模块归档
   - 35 个 REV-004 文件归入 evidence/rev004-accounting/
   - 7 个通用 bugfix 文件归入 evidence/bugfix/ 和 bugfix/frontend/
   - 新建 rev005-invoice/、rev006-reminder/、rev007-statistics/ 目录

4. guides/ 清理
   - 14 个 REV004_*.md 移入 evidence/rev004-accounting/

5. 遗留文件处理
   - docs/research/ 归档到 Archive/06_Migration_Plans/
   - backend-check detached worktrees 清理

6. 交叉引用修复
   - 006-reminder-event-design → 003-rev006-reminder-event-design
   - docs/guides/REV004_ → docs/evidence/rev004-accounting/REV004_

7. DB 设计文档修正(01_Database_Design.md)
   - biz_invoice 明确为开票配置表,非发票记录表
   - 新增 biz_invoice_record 为发票申请/结果主表
   - 新增 biz_charge_invoice_rel 账单-发票关联说明
   - REV-005 承接口径表名全部修正

8. 发票审计证据
   - 新增 evidence/rev005-invoice/2026-06-16-invoice-document-audit.md
2026-06-16 11:47:16 +08:00

123 lines
3.4 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 违约金减免现结构与老字典差异摘要2026-04-14
## 结论
当前 REV004 违约金减免结构已经对齐老字典/老表结构的核心骨架:
- `LateFeeType` 仍保持 `1=按金额 / 2=按日期`
- 已承接申请人、联系电话、备注
- 已承接 `StartDate/EndDate`
- 已承接账单维度 `chargeId(FeeId)`
但当前更偏**申请契约 + 日志/读模型承接**,并未完整复刻老系统执行态表模型。
## 老字典/老表结构证据
### 主表 `PM_LATEFEE_RECORDS`
来源:`营收数据字典.md:3117-3126`
- `Applicant`
- `Mobile`
- `ApplyType`
- `LateFeeType`
- `State`
- `Remark`
- `TaskId`
- `StepId`
- `FlowRemark`
- `BusinessType`
### 明细表 `PM_LATEFEE_RECORD_DETAILS`
来源:`营收数据字典.md:3143-3158`
- `CustId/CustCode/CustName/CustAddress`
- `BillMonth`
- `LateFee`
- `ReduceMoney`
- `NewLateFee`
- `StartDate`
- `EndDate`
- `ProcType/ProcPerson/ProcDate/ProcRemark`
- `State`
- `FeeId`
### 老字典枚举
来源:`营收数据字典.md:5683-5697`
- `LateFeeReason`: `1=用户协商`, `2=其它`
- `LateFeeType`: `1=按金额`, `2=按日期`
## 当前结构证据
### DDL 草案
来源:`sql/rev004/REV004_accounting_adjustments_ddl.sql:289-403`
- 主表 `biz_latefee_reduce`
- `applicant_name`
- `applicant_mobile`
- `late_fee_type`
- `apply_reason_code`
- `remark`
- `approval_status`
- `reduce_status`
- 明细表 `biz_latefee_reduce_detail`
- `charge_id`
- `cust_id/cust_code/cust_name/cust_address`
- `bill_month`
- `start_date/end_date`
- `late_fee_before`
- `reduce_amount`
- `late_fee_after`
- `proc_type/proc_person/proc_time/proc_remark`
### 当前批量提交契约
来源:
- `AccountingAdjustUnsoldLateFeeReduceBatchSubmitReqVO`
- `AccountingAdjustUnsoldLateFeeReduceBatchItemReqVO`
当前 outer
- `lateFeeType`
- `applicant`
- `contactMobile`
- `applyReason`
- `remark`
- `attachmentRefs`
- `items`
当前 item
- `chargeId`
- `adjustmentNo`
- `lateFeeReduceAmount`
- `startDate`
- `endDate`
- 兼容项:`applyReason/remark/attachmentRefs`
## 已对齐项
1. `LateFeeType` 语义已对齐老字典
2. `Applicant/Mobile` 已有对应字段
3. `Remark` 已有对应字段
4. `StartDate/EndDate` 已有对应字段
5. `FeeId -> chargeId` 已有明确对应
6. `ReduceMoney -> lateFeeReduceAmount/reduce_amount` 语义已对齐
7. detail / log-detail / process 已可读出 late-fee 扩展字段
## 未完全落地项
1. **ApplyType / LateFeeReason 字典口径未完全统一**
- 老字典:`1=用户协商, 2=其它`
- 当前前端历史口径曾使用不同原因值
2. **State 未按老系统单字段口径落地**
- 当前主要使用 `approvalStatus/resultStatus/writeBackStatus`
3. **按日期模式仍偏申请态**
- 还未形成完整审批执行/计算回写
4. **执行结果落表未完整 runtime 化**
- DDL 草案已具备 `late_fee_before/reduce_amount/late_fee_after`
- 但当前核心还是契约 + 日志承接
5. **处理过程字段未完整 runtime 落地**
- `ProcType/ProcPerson/ProcDate/ProcRemark`
6. **老流程字段未完整复刻**
- `StepId/FlowRemark/BusinessType`
## 优先级建议
### P0
- 统一 `applyReason``LateFeeReason` 口径
- 给出老 `State` 与当前审批/回写状态映射表
### P1
- 补齐 `lateFeeType=2` 按日期模式执行态
- 审批通过后把结果正式落到 `biz_latefee_reduce / biz_latefee_reduce_detail`
### P2
- 再决定是否需要复刻 `StepId/FlowRemark/BusinessType/applicant_id`