Files
bj_power/bj_power_mes/schema/agv_vehicle_state.go
T
SunYF 46fcb59079 feat: 退料闭环定稿(损耗台账/备料清单/退料AGV自动派车/剩余量参考)+ 工位托盘守卫
- MES 新增损耗台账 loss_ledger,差异确认损耗接口 ConfirmReceiveLoss(按工单归集)
- 备料清单 preparation:MES 按 日计划×工单×工位×物料 实时计算,WMS 只读展示 PreparationList
- 退料闭环:N5 工位托盘守卫(未完成禁止退料)、退料 AGV 自动派车(JBT21 空位判定 + 托盘回收链路)、退料参考剩余量接口(应剩余=实备-已耗-已退-已损)
- 新增 AGV 车辆状态表 agv_vehicle_state 及查询
- 整合接驳台/叫料池/库存锁既有闭环,清理 sql 目录注释生成脚本与 catalog,更新文档
2026-11-04 19:06:03 +08:00

34 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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("备注(人工修改原因等)"),
}
}