feat: 装配线看板修正、统一密钥Hardman_2026、操作日志追溯、日志按天存储
Dashboard 移除 CNC/清洗机等不存在设备,改为纯装配线看板(扫码枪+拧紧枪+人工);JWT/内部token统一为 Hardman_2026 写入各 etc/*.yaml,MES 建表 DSN 改读 yaml;event_log 增加 workOrderNo/operator,BOM/备料/PLC下发/拧紧/扫码报工/半成品/AGV 全链路埋点,日志页支持工单号/操作人筛选;MES/WMS 日志按天存储(dailyWriter),WMS SetWriter 用 logx.NewWriter 适配
This commit is contained in:
@@ -3,11 +3,28 @@ package eventbus
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 事件构造辅助函数
|
||||
|
||||
// NewProductionEvent 构建装配线操作日志事件(payload 内可含
|
||||
// workOrderNo/orderNo、workpieceNo/sn、operator、stepCode 等键,写入事件日志表)
|
||||
func NewProductionEvent(eventType EventType, description string, payload map[string]any) Event {
|
||||
if payload == nil {
|
||||
payload = map[string]any{}
|
||||
}
|
||||
payload["description"] = description
|
||||
return Event{
|
||||
ID: fmt.Sprintf("%s-%d", strings.ToLower(string(eventType)), time.Now().UnixNano()),
|
||||
Type: eventType,
|
||||
Source: "production",
|
||||
Timestamp: time.Now(),
|
||||
Payload: payload,
|
||||
}
|
||||
}
|
||||
|
||||
// NewTempSlotChangedEvent 构建暂存台槽位变更事件
|
||||
func NewTempSlotChangedEvent(slotNo, jobID int, action string) Event {
|
||||
return Event{
|
||||
|
||||
Reference in New Issue
Block a user