Files
bj_power/bj_power_mes/schema/agv_vehicle_state.go
T

34 lines
1.8 KiB
Go
Raw Normal View History

package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
)
// AgvVehicleState AGV 载货状态台账(按车辆编号逐台维护,2026-11-04 防撞校验补做)。
// 海康 RCS-Lite 协议无直接「载货/有无货」布尔字段(queryAgvStatus 仅有 podCode 背货架编号可作间接参考),
// 因此本系统自维护:取货确认(ConfirmLoadAndGo)置 true、卸货确认(ConfirmUnloadRelease)置 false;
// RCS 回调/查询回写 agv_code 绑定具体车辆;WMS/MES 人工维护入口留痕操作人与时间。
// 用途:派车前防撞硬拒——AGV 载货=true 且 目标接驳台有托盘 → 拒绝派车。
type AgvVehicleState struct {
ent.Schema
}
func (AgvVehicleState) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "agv_vehicle_state"}, entsql.WithComments(true),
schema.Comment("AgvVehicleState AGV 载货状态台账:按 agv_code 逐台记录有托盘/空车,取货/卸货确认与人工维护写入,派车防撞校验消费。")}
}
func (AgvVehicleState) Fields() []ent.Field {
return []ent.Field{
field.String("agv_code").Unique().MaxLen(32).Comment("车辆编号(RCS robotCode/agvCode;RCS 未分车时=DEFAULT 未知车辆)"),
field.Bool("has_pallet").Default(false).Comment("载货状态:true=有托盘(载货) false=空车"),
field.String("source").Default("MANUAL").MaxLen(20).Comment("状态来源:AUTO_LOAD取货确认/AUTO_UNLOAD卸货确认/MANUAL人工维护"),
field.String("updated_by").Default("").MaxLen(64).Comment("最近更新人"),
field.Int64("updated_at").Default(0).Comment("最近更新时间 unix秒"),
field.String("remark").Default("").MaxLen(200).Comment("备注(人工修改原因等)"),
}
}