Files
shanxia2.0/openspec/changes/vehicle-urea-management/design.md
T
2026-06-29 11:15:39 +08:00

57 lines
1.7 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.
## Context
已有 ETC/加油(申请→发放看板)与车辆维保(申请→处理看板)两套实现。尿素申请含 **计划金额 + 入库数量**,发放为 **实付金额**,语义上更接近 ETC 的「待发放/已发放」,但申请字段更丰富。
约束:MySQL 5.7、租户隔离、Fresh Mint UI、frontend 静态路由、软删除。
## Goals / Non-Goals
**Goals:** 双菜单 CRUD、1:0~1 关联、无申请补录、发放金额默认带出申请金额、角色菜单幂等迁移。
**Non-Goals:** 审批、库存系统、尿素主数据、选车提醒、车辆状态联动。
## Decisions
### D1 平行复制 ETC 模块
新建 `pl_vehicle_urea_*` 表与 Service,发放页复用 `disburse-board` 模式。理由:与 ETC 文案/状态一致,工期可控。
### D2 双金额字段
- 申请表 `apply_amount`(计划,必填)
- 发放表 `amount`(实付,必填)
- 发放弹窗默认 `amount = apply_amount`,允许修改。
### D3 状态 disbursed
不设 `is_processed`;发放成功 → 申请 `disbursed`。
### D4 单位与数量
`unit` varchar + UI 预设「吨桶」+ allow-create;`quantity` decimal(10,2) 必填 > 0。
### D5 单号
`SXNS`(尿素申请)、`SXUF`(尿素发放)。
### D6 角色菜单 id
super_admin 用固定 id `PL_Urea_RM_SA_*`;其他角色用 `MD5(CONCAT(role_id, ':', menu_id))`,避免 `UUID()` 1062。
## Risks / Trade-offs
| 风险 | 缓解 |
|------|------|
| 申请/发放金额不一致难对账 | 看板同时展示两列金额 |
| 与 ETC 代码重复 | 接受;第三模块后再抽象 |
## Migration Plan
1. 执行 `2026-06-29-pl-vehicle-urea.sql`
2. 部署后端与前端
3. 重新登录刷新菜单
## Open Questions
- (无)