Pārlūkot izejas kodu

docs: 小票模板确认——parking_lot/channel动态读取+短流水号+二维码UUID

lq 1 mēnesi atpakaļ
vecāks
revīzija
34b471a0c5

+ 32 - 16
docs/superpowers/specs/2026-07-30-ticket-printer-design.md

@@ -58,26 +58,42 @@
 | `internal/modules/printer/service/service.go` | ESC/POS 指令封装 + 串口通信 |
 | `internal/modules/printer/service/escpos.go` | ESC/POS 协议常量与指令构建 |
 
-## 7. ESC/POS 小票模板
+## 7. 小票模板
 
 ```
-          ┌──────────────┐
-          │  龙弛智慧停车  │  (居中)
-          │  LC PARKING   │
-          │──────────────│
-          │ 入场时间       │
-          │ 2026-07-30    │
-          │ 10:30:00      │
-          │              │
-          │ [二维码]      │
-          │              │
-          │ NO: ts_xxx   │
-          │──────────────│
-          │ 请保留此小票   │
-          │ 出场扫码缴费   │
-          └──────────────┘
+┌──────────────────────────────┐
+│    PARKING TICKET            │
+│    停车票                     │
+│                              │
+│    {parking_lot.lot_name}    │
+│    {parking_lot.type_text}   │
+│                              │
+│    PARK AT YOUR OWN RISK     │
+│──────────────────────────────│
+│    In-Time::{entry_time}     │
+│    InGate::{channel.code}    │
+│    Veh No::{plate_number}    │  ← 识别到则印,未识别留空
+│──────────────────────────────│
+│    Slip No::{ticket_id}      │  ← digital_ticket.id 短流水号
+│──────────────────────────────│
+│      [二维码]                 │  ← 编码 ticket_no(full UUID)
+│──────────────────────────────│
+│  {payment_hint}              │  ← 配置项,如 "SCAN AND PAY..."
+└──────────────────────────────┘
 ```
 
+数据来源:
+| 字段 | 来源 |
+|------|------|
+| parking_lot | `parking_lot.lot_name` |
+| type_text | `parking_lot.remark` 或写死 "A-General Car" |
+| entry_time | `time.Now().Format("02-01-2006 15:04:05")` |
+| in_gate | `channel.channel_code`(按钮事件时指定通道) |
+| veh_no | 车牌识别结果,无则空 |
+| slip_no | `digital_ticket.id`(自增整数) |
+| 二维码 | `digital_ticket.ticket_no`(32位UUID) |
+| payment_hint | 系统配置表或写死 |
+
 ## 8. 文件变更
 
 | 文件 | 操作 |