feat: 大屏改为纯流式自适应布局,新增KPI带与产线动态拓扑地图
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/schema"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/index"
|
||||
)
|
||||
|
||||
// BackupRecord 备份记录:每次「备份到外部存储(U盘/移动硬盘)」写一条。
|
||||
// 清理前校验 backup_record 对该时间窗的完整覆盖,覆盖不全则拒绝清理。
|
||||
//
|
||||
// 时间字段统一用 Int64 unix 秒(与 WMS 端一致,便于跨库覆盖比较);
|
||||
// 各业务表 created_at 类型不一(MES tz-time / WMS bigint),由备份/清理层统一解析。
|
||||
type BackupRecord struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (BackupRecord) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{
|
||||
entsql.Annotation{Table: "backup_record"},
|
||||
entsql.WithComments(true),
|
||||
schema.Comment("BackupRecord 备份记录:备份到外部存储写一条,清理前校验时间窗覆盖"),
|
||||
}
|
||||
}
|
||||
|
||||
func (BackupRecord) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("id").Positive(),
|
||||
field.Int64("executedAt").DefaultFunc(backupRecordNow).Comment("备份执行时刻(unix秒)"),
|
||||
field.Int64("rangeStart").Comment("备份范围开始(unix秒,含)"),
|
||||
field.Int64("rangeEnd").Comment("备份范围结束(unix秒,含)"),
|
||||
field.String("backupPath").Comment("备份包(zip)在目标盘的完整路径"),
|
||||
field.Int64("totalSize").Default(0).Comment("备份包总字节数"),
|
||||
// 各数据项及大小:[{name,rows,bytes}],name 与备份内目录一致
|
||||
field.String("itemsJSON").Comment("各数据项及大小(JSON数组:[{name,rows,bytes}])"),
|
||||
field.String("status").Default("success").MaxLen(16).Comment("success/failed/partial"),
|
||||
field.String("operator").Default("").MaxLen(64).Comment("操作人"),
|
||||
field.String("checksum").Default("").MaxLen(64).Comment("备份包校验和(sha256,基于 manifest)"),
|
||||
field.String("scope").Default("mes").MaxLen(8).Comment("写入方 mes/wms"),
|
||||
}
|
||||
}
|
||||
|
||||
func (BackupRecord) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("rangeStart"),
|
||||
index.Fields("rangeEnd"),
|
||||
index.Fields("status"),
|
||||
}
|
||||
}
|
||||
|
||||
// backupRecordNow 备份执行时刻(unix 秒)。
|
||||
func backupRecordNow() int64 { return time.Now().Unix() }
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
// LinePoint 产线点位台账:记录每个点位当前存放的工件(唯一事实源)。
|
||||
// 产线布局(修正版):上料位 IN(工位1/2间主线,带传感器)、工位 1~10(有终端)、
|
||||
// 末端下料检测位 11(上排末端)/12(下排末端)(无终端,PLC 点位)、缓存位 C1~C8、
|
||||
// 每个有终端工位配 R1、R2 两个接驳台(AGV 点位,PLC 只读到位信号)。
|
||||
// 每个有终端工位配左(L)、右(R)两个接驳台(AGV 点位,PLC 只读到位信号)。
|
||||
type LinePoint struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user