feat: 新增 AgvPoint 点位表及客户端,支持点位编码与接驳台绑定

This commit is contained in:
SunYF
2026-11-03 10:17:49 +08:00
parent fd2f0e2767
commit 2ccf9bb9ca
62 changed files with 5501 additions and 238 deletions
+38
View File
@@ -9,6 +9,40 @@ import (
)
var (
// AgvPointColumns holds the columns for the "agv_point" table.
AgvPointColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "position_code", Type: field.TypeString, Unique: true, Size: 32, Comment: "AGV 点位编码(硬件映射=送往 RCS 的目标坐标,软件不可改)"},
{Name: "name", Type: field.TypeString, Size: 64, Comment: "点位显示名称(可编辑)", Default: ""},
{Name: "is_dock", Type: field.TypeBool, Comment: "是否接驳台点位(true=绑定接驳台,false=纯待命/充电点位)", Default: false},
{Name: "dock_id", Type: field.TypeInt, Nullable: true, Comment: "绑定的接驳台 ID(is_dock=true 时硬件内置强绑定)"},
{Name: "enabled", Type: field.TypeBool, Comment: "是否启用(可编辑)", Default: true},
{Name: "created_at", Type: field.TypeTime},
}
// AgvPointTable holds the schema information for the "agv_point" table.
AgvPointTable = &schema.Table{
Name: "agv_point",
Comment: "AgvPoint AGV 点位(硬件级别真源):点位编码与接驳台一一对应,软件仅可启用/停用与改显示名。",
Columns: AgvPointColumns,
PrimaryKey: []*schema.Column{AgvPointColumns[0]},
Indexes: []*schema.Index{
{
Name: "agvpoint_position_code",
Unique: true,
Columns: []*schema.Column{AgvPointColumns[1]},
},
{
Name: "agvpoint_is_dock",
Unique: false,
Columns: []*schema.Column{AgvPointColumns[3]},
},
{
Name: "agvpoint_enabled",
Unique: false,
Columns: []*schema.Column{AgvPointColumns[5]},
},
},
}
// AgvTasksColumns holds the columns for the "agv_tasks" table.
AgvTasksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -1396,6 +1430,7 @@ var (
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
AgvPointTable,
AgvTasksTable,
AlertTable,
AlertRuleTable,
@@ -1438,6 +1473,9 @@ var (
)
func init() {
AgvPointTable.Annotation = &entsql.Annotation{
Table: "agv_point",
}
AgvTasksTable.Annotation = &entsql.Annotation{
Table: "agv_tasks",
}