| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package dao
- import (
- "time"
- "wails-app/internal/global"
- )
- // IncidentRecord 异常事件记录(事件与工单合一)。
- // 自动埋点(通行失败、设备离线、人工抬杆)与人工上报共用一张表,
- // 处置过程(状态流转、处置方式、金额、处理人)随记录保存。
- type IncidentRecord struct {
- global.GVA_MODEL
- IncidentNo string `gorm:"size:32;uniqueIndex" json:"incident_no"`
- Category string `gorm:"size:32;index" json:"category"`
- Source string `gorm:"size:20" json:"source"`
- Level string `gorm:"size:20" json:"level"`
- Status string `gorm:"size:20;default:pending;index;index:idx_incident_device_status,priority:2" json:"status"`
- // VehicleRecordID 是停车会话(历史表名 vehicle_record)的关联 ID。
- VehicleRecordID uint `gorm:"index" json:"vehicle_record_id"`
- DigitalTicketID uint `gorm:"index" json:"digital_ticket_id"`
- PaymentRecordID uint `gorm:"index" json:"payment_record_id"`
- GateCommandID uint `gorm:"index" json:"gate_command_id"`
- TicketNo string `gorm:"size:64" json:"ticket_no"`
- PlateNumber string `gorm:"size:20" json:"plate_number"`
- RFIDTag string `gorm:"size:40" json:"rfid_tag"`
- ParkingLotID uint `json:"parking_lot_id"`
- ParkingLotName string `gorm:"size:100" json:"parking_lot_name"`
- ChannelID uint `json:"channel_id"`
- ChannelCode string `gorm:"size:32" json:"channel_code"`
- ChannelName string `gorm:"size:100" json:"channel_name"`
- DeviceCode string `gorm:"size:32;index:idx_incident_device_status,priority:1" json:"device_code"`
- DeviceName string `gorm:"size:100" json:"device_name"`
- OperatorID uint `json:"operator_id"`
- Description string `gorm:"size:500" json:"description"`
- Detail string `gorm:"type:text" json:"detail"`
- HandlerID uint `json:"handler_id"`
- HandledAt *time.Time `json:"handled_at"`
- HandleType string `gorm:"size:32" json:"handle_type"`
- HandleRemark string `gorm:"size:500" json:"handle_remark"`
- ForceFreeAmount float64 `json:"force_free_amount"`
- EventLog string `gorm:"type:text" json:"event_log"`
- }
- func (IncidentRecord) TableName() string { return "incident_record" }
- // DeviceCommandLog 道闸指令流水:每次开闸/关闸命令的审计记录。
- // 开闸失败时通过 incident_id 关联对应的异常事件。
- type DeviceCommandLog struct {
- global.GVA_MODEL
- DeviceCode string `gorm:"size:32;index" json:"device_code"`
- DeviceName string `gorm:"size:64" json:"device_name"`
- Action string `gorm:"size:10" json:"action"` // open / close
- Source string `gorm:"size:20" json:"source"` // passage / manual / test
- OperatorID uint `json:"operator_id"`
- SessionID uint `json:"session_id"`
- IncidentID uint `json:"incident_id"`
- Result string `gorm:"size:20" json:"result"` // success / failed
- ErrorMessage string `gorm:"size:500" json:"error_message"`
- DurationMs int64 `json:"duration_ms"`
- }
- func (DeviceCommandLog) TableName() string { return "device_command_log" }
|