Files
bj_power/bj_power_mes/ent/agvtask/agvtask.go
T
SunYF 42bcf395d2 feat: AGV三段链安全机制、补料/损耗/下班闭环、接驳台左右互换
AGV 调度:
- 任务重构为 GO_LOAD/TRANSPORT/EMPTY_RETURN/FREE 三段链,到位即停(ARRIVED)需人工确认装卸
- 自由调度单点步进,每段强制弹"请确保路径畅通无杂物";托盘回收独立工作台
- 接驳台 PLC 传感器检测到托盘即自动卸货放行,传感器故障由人工按钮兜底(无轮询)
- 车辆状态只读展示(海康3.1.7 queryAgvStatus),调度仍由 RCS 负责

物料闭环:
- 补料管理(SHORTAGE):工位申请 + 主管审批调增叫料池额度,与借料/差异补发三轨并行
- 损耗台账(loss_ledger):退料实际 < 理论必填原因、后审核,工单不记损耗
- 退料强制指定左/右接驳台,WMS 库管可代工位退料

下班闭环:
- 工位终端自检接驳台剩余物料后下班;库管收货 + 托盘拉走后事件驱动自动结班
- 退出登录未下班仅作安全提示(不强制拦截、不新增责任审批)

接驳台左右按操作员朝向建模(dock.side 字段),废除"奇左偶右"隐式约定;
看板标签 / seed / 迁移补丁 / 布局文档统一为中文左/右。

产线布局说明:C1 前线头 AGV 点、C15 后线尾 AGV 点、外部 O1/O2/O3 散点,
清理修订痕迹为最终态描述。
2026-11-03 18:29:31 +08:00

261 lines
11 KiB
Go

// Code generated by ent, DO NOT EDIT.
package agvtask
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the agvtask type in the database.
Label = "agv_task"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTaskNo holds the string denoting the task_no field in the database.
FieldTaskNo = "task_no"
// FieldHikTaskCode holds the string denoting the hik_task_code field in the database.
FieldHikTaskCode = "hik_task_code"
// FieldSourceDock holds the string denoting the source_dock field in the database.
FieldSourceDock = "source_dock"
// FieldTargetDock holds the string denoting the target_dock field in the database.
FieldTargetDock = "target_dock"
// FieldMaterialsJSON holds the string denoting the materials_json field in the database.
FieldMaterialsJSON = "materials_json"
// FieldRelatedRequestNo holds the string denoting the related_request_no field in the database.
FieldRelatedRequestNo = "related_request_no"
// FieldRelatedOutboundNo holds the string denoting the related_outbound_no field in the database.
FieldRelatedOutboundNo = "related_outbound_no"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldKind holds the string denoting the kind field in the database.
FieldKind = "kind"
// FieldBizType holds the string denoting the biz_type field in the database.
FieldBizType = "biz_type"
// FieldBizNo holds the string denoting the biz_no field in the database.
FieldBizNo = "biz_no"
// FieldChainNo holds the string denoting the chain_no field in the database.
FieldChainNo = "chain_no"
// FieldAutoEnd holds the string denoting the auto_end field in the database.
FieldAutoEnd = "auto_end"
// FieldAgvCode holds the string denoting the agv_code field in the database.
FieldAgvCode = "agv_code"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldDispatchedAt holds the string denoting the dispatched_at field in the database.
FieldDispatchedAt = "dispatched_at"
// FieldArrivedAt holds the string denoting the arrived_at field in the database.
FieldArrivedAt = "arrived_at"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the agvtask in the database.
Table = "agv_tasks"
)
// Columns holds all SQL columns for agvtask fields.
var Columns = []string{
FieldID,
FieldTaskNo,
FieldHikTaskCode,
FieldSourceDock,
FieldTargetDock,
FieldMaterialsJSON,
FieldRelatedRequestNo,
FieldRelatedOutboundNo,
FieldStatus,
FieldKind,
FieldBizType,
FieldBizNo,
FieldChainNo,
FieldAutoEnd,
FieldAgvCode,
FieldOperator,
FieldDispatchedAt,
FieldArrivedAt,
FieldRemark,
FieldCreatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// TaskNoValidator is a validator for the "task_no" field. It is called by the builders before save.
TaskNoValidator func(string) error
// DefaultHikTaskCode holds the default value on creation for the "hik_task_code" field.
DefaultHikTaskCode string
// HikTaskCodeValidator is a validator for the "hik_task_code" field. It is called by the builders before save.
HikTaskCodeValidator func(string) error
// DefaultSourceDock holds the default value on creation for the "source_dock" field.
DefaultSourceDock string
// SourceDockValidator is a validator for the "source_dock" field. It is called by the builders before save.
SourceDockValidator func(string) error
// DefaultTargetDock holds the default value on creation for the "target_dock" field.
DefaultTargetDock string
// TargetDockValidator is a validator for the "target_dock" field. It is called by the builders before save.
TargetDockValidator func(string) error
// DefaultMaterialsJSON holds the default value on creation for the "materials_json" field.
DefaultMaterialsJSON string
// MaterialsJSONValidator is a validator for the "materials_json" field. It is called by the builders before save.
MaterialsJSONValidator func(string) error
// DefaultRelatedRequestNo holds the default value on creation for the "related_request_no" field.
DefaultRelatedRequestNo string
// RelatedRequestNoValidator is a validator for the "related_request_no" field. It is called by the builders before save.
RelatedRequestNoValidator func(string) error
// DefaultRelatedOutboundNo holds the default value on creation for the "related_outbound_no" field.
DefaultRelatedOutboundNo string
// RelatedOutboundNoValidator is a validator for the "related_outbound_no" field. It is called by the builders before save.
RelatedOutboundNoValidator func(string) error
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
StatusValidator func(string) error
// DefaultKind holds the default value on creation for the "kind" field.
DefaultKind string
// KindValidator is a validator for the "kind" field. It is called by the builders before save.
KindValidator func(string) error
// DefaultBizType holds the default value on creation for the "biz_type" field.
DefaultBizType string
// BizTypeValidator is a validator for the "biz_type" field. It is called by the builders before save.
BizTypeValidator func(string) error
// DefaultBizNo holds the default value on creation for the "biz_no" field.
DefaultBizNo string
// BizNoValidator is a validator for the "biz_no" field. It is called by the builders before save.
BizNoValidator func(string) error
// DefaultChainNo holds the default value on creation for the "chain_no" field.
DefaultChainNo string
// ChainNoValidator is a validator for the "chain_no" field. It is called by the builders before save.
ChainNoValidator func(string) error
// DefaultAutoEnd holds the default value on creation for the "auto_end" field.
DefaultAutoEnd bool
// DefaultAgvCode holds the default value on creation for the "agv_code" field.
DefaultAgvCode string
// AgvCodeValidator is a validator for the "agv_code" field. It is called by the builders before save.
AgvCodeValidator func(string) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
OperatorValidator func(string) error
// DefaultDispatchedAt holds the default value on creation for the "dispatched_at" field.
DefaultDispatchedAt int64
// DefaultArrivedAt holds the default value on creation for the "arrived_at" field.
DefaultArrivedAt int64
// DefaultRemark holds the default value on creation for the "remark" field.
DefaultRemark string
// RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
RemarkValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
)
// OrderOption defines the ordering options for the AgvTask queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByTaskNo orders the results by the task_no field.
func ByTaskNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTaskNo, opts...).ToFunc()
}
// ByHikTaskCode orders the results by the hik_task_code field.
func ByHikTaskCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHikTaskCode, opts...).ToFunc()
}
// BySourceDock orders the results by the source_dock field.
func BySourceDock(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSourceDock, opts...).ToFunc()
}
// ByTargetDock orders the results by the target_dock field.
func ByTargetDock(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTargetDock, opts...).ToFunc()
}
// ByMaterialsJSON orders the results by the materials_json field.
func ByMaterialsJSON(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaterialsJSON, opts...).ToFunc()
}
// ByRelatedRequestNo orders the results by the related_request_no field.
func ByRelatedRequestNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRelatedRequestNo, opts...).ToFunc()
}
// ByRelatedOutboundNo orders the results by the related_outbound_no field.
func ByRelatedOutboundNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRelatedOutboundNo, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByKind orders the results by the kind field.
func ByKind(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldKind, opts...).ToFunc()
}
// ByBizType orders the results by the biz_type field.
func ByBizType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBizType, opts...).ToFunc()
}
// ByBizNo orders the results by the biz_no field.
func ByBizNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBizNo, opts...).ToFunc()
}
// ByChainNo orders the results by the chain_no field.
func ByChainNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChainNo, opts...).ToFunc()
}
// ByAutoEnd orders the results by the auto_end field.
func ByAutoEnd(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAutoEnd, opts...).ToFunc()
}
// ByAgvCode orders the results by the agv_code field.
func ByAgvCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAgvCode, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByDispatchedAt orders the results by the dispatched_at field.
func ByDispatchedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDispatchedAt, opts...).ToFunc()
}
// ByArrivedAt orders the results by the arrived_at field.
func ByArrivedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldArrivedAt, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}