feat: 新增收集式校验错误弹窗及工位报警语音播报
新增 ErrorListDialog 组件用于统一展示结构化校验错误信息,实现报错一次收全;新增工位报警语音播报功能,通过浏览器 SpeechSynthesis 播放本工位相关报警;调整物料类别及序列号字段文案,移除「其他」类别;新增工单实际开始字段及采集方式配置;优化 AGV 及 PlcSend 页签刷新逻辑;新增看板物料追溯及工位报警接口;删除 PLC 强制写 M 位及相关测试代码;同步数据库字段注释及补丁。
This commit is contained in:
@@ -45,6 +45,7 @@ type FrontProduction struct {
|
||||
InLine int `json:"inLine"`
|
||||
DeviceOnline int `json:"deviceOnline"`
|
||||
DeviceTotal int `json:"deviceTotal"`
|
||||
CycleTimeMin float64 `json:"cycleTime"` // 实际生产节拍(分钟)
|
||||
StationSummary StationSummary `json:"stationSummary"`
|
||||
}
|
||||
|
||||
@@ -56,15 +57,20 @@ type FrontMovement struct {
|
||||
Material string `json:"material"`
|
||||
Qty int `json:"qty"`
|
||||
Operator string `json:"operator"`
|
||||
Batch string `json:"batch"` // 批次号
|
||||
}
|
||||
|
||||
// FrontWarehouse 仓储动态(前端 WarehouseOverview,数据源 WMS 8890)
|
||||
type FrontWarehouse struct {
|
||||
TotalStock int `json:"totalStock"`
|
||||
MaterialTypes int `json:"materialTypes"`
|
||||
InboundToday int `json:"inboundToday"`
|
||||
OutboundToday int `json:"outboundToday"`
|
||||
Movements []FrontMovement `json:"movements"`
|
||||
TotalStock int `json:"totalStock"`
|
||||
MaterialTypes int `json:"materialTypes"`
|
||||
InboundToday int `json:"inboundToday"`
|
||||
OutboundToday int `json:"outboundToday"`
|
||||
LocationUsed int `json:"locationUsed"`
|
||||
LocationTotal int `json:"locationTotal"`
|
||||
PendingInbound int `json:"pendingInbound"`
|
||||
PendingOutbound int `json:"pendingOutbound"`
|
||||
Movements []FrontMovement `json:"movements"`
|
||||
}
|
||||
|
||||
// FrontProgress 当前订单卡片(前端 ProductionProgress)
|
||||
@@ -101,6 +107,8 @@ type FrontDashboard struct {
|
||||
Progress FrontProgress `json:"progress"`
|
||||
Traces []TraceItem `json:"traces"`
|
||||
Trends FrontTrends `json:"trends"`
|
||||
// Alarms 仅用于前端语音播报(D2),不渲染到屏幕(报喜不报忧)。
|
||||
Alarms []AlarmItem `json:"alarms"`
|
||||
}
|
||||
|
||||
// DashboardFrontSnapshot 看板前端快照:富聚合 → 前端契约映射,走同一缓存(60s + 防击穿)。
|
||||
@@ -160,16 +168,28 @@ func mapFrontDashboard(r *DashboardSnapshot) *FrontDashboard {
|
||||
InLine: r.Production.InLine,
|
||||
DeviceOnline: onlineDevices,
|
||||
DeviceTotal: len(r.Equipment) * 2,
|
||||
CycleTimeMin: r.Production.CycleTimeMin,
|
||||
StationSummary: summary,
|
||||
}
|
||||
|
||||
// -------- warehouse --------
|
||||
movements := make([]FrontMovement, 0, len(r.Warehouse.Movements))
|
||||
for _, m := range r.Warehouse.Movements {
|
||||
movements = append(movements, FrontMovement{
|
||||
ID: m.ID, Time: m.Time, Type: m.Type, Material: m.Material,
|
||||
Qty: m.Qty, Operator: m.Operator, Batch: m.Batch,
|
||||
})
|
||||
}
|
||||
f.Warehouse = FrontWarehouse{
|
||||
TotalStock: r.Warehouse.TotalQty,
|
||||
MaterialTypes: r.Warehouse.MaterialTypes,
|
||||
InboundToday: r.Warehouse.InToday,
|
||||
OutboundToday: r.Warehouse.OutToday,
|
||||
Movements: []FrontMovement{},
|
||||
TotalStock: r.Warehouse.TotalQty,
|
||||
MaterialTypes: r.Warehouse.MaterialTypes,
|
||||
InboundToday: r.Warehouse.InToday,
|
||||
OutboundToday: r.Warehouse.OutToday,
|
||||
LocationUsed: r.Warehouse.LocationUsed,
|
||||
LocationTotal: r.Warehouse.LocationTotal,
|
||||
PendingInbound: r.Warehouse.PendingInbound,
|
||||
PendingOutbound: r.Warehouse.PendingOutbound,
|
||||
Movements: movements,
|
||||
}
|
||||
|
||||
// -------- 当前订单卡片 --------
|
||||
@@ -211,6 +231,11 @@ func mapFrontDashboard(r *DashboardSnapshot) *FrontDashboard {
|
||||
if f.Trends.Production == nil {
|
||||
f.Trends.Production = []TrendPoint{}
|
||||
}
|
||||
// 报警仅透传给前端做语音播报(D2),屏幕不渲染(报喜不报忧)。
|
||||
f.Alarms = r.Alarms
|
||||
if f.Alarms == nil {
|
||||
f.Alarms = []AlarmItem{}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user