一、AGV 挂起动作引擎(弃显式任务队列、弃并发硬拒) - 新增 internal/logic/agv_pending.go:待发动作直接挂任务(pending_action + pending_since), CONTINUE_LIFT(举升完成→continueTask#1)/ WAIT_DROP_CONFIRM(人工确认放下→continueTask#2) / FREE_ROBOT(末组完成→freeRobot);系统动作超 60s 未触发转预警人工重试,绝不自动重发 - Client 新增 ContinueTask(RCS 2.1.2) / FreeRobot(3.1.2),仅点名释放指定车,禁止释放全部 - agv_task 增 pending_action/pending_since 字段,ent 重生成 + db.go 幂等迁移补丁 + migrateonce - 回调按 B01/B02/C01 模板编排:业务流转到位即自动放行放下、回调自动放车; 仅人工派车(MANUAL)挂 WAIT_DROP_CONFIRM;新增 /agv/confirm-drop、/agv/pending/retry - 前端 AgvManual/Agv 确认放下、挂起重试按钮与等待提示联动 二、智能跟车 + 动态目标截断流转引擎 - 新增 internal/logic/flow_engine.go:事件驱动(报工/扫码),读 48 位物理快照,从下游往上游算, 前方占用则动态截断到最近空闲缓存位;IN_TRANSIT 在途闭锁防重复下发,MW=0 才确认到位落台账; 主线占用=台账 OR 传感器,工位 G 位只认台账;在途超 5s 落预警 - workpiece 增 flow_transit_mw/target/at 字段,ent 重生成 + 迁移补丁 三、PLC 读取优化与诊断 - 新增 internal/plc/snapshot_cache.go:2s TTL + singleflight + 写失效,合并 SSE/PLC监控/流转引擎 的重复点位读取;tcp.go 读块重构、localip.go 多网卡、plcdiag 诊断工具、plc_monitor/logging 配套 四、文档与前端 - help.js 重写「工位下发」帮助:明确报工自动驱动流转 vs 下发路线码的定位、缺料/握手/撤回边界 - 案例.md 补充定稿说明;public/index.html 构建指纹更新
283 lines
12 KiB
Go
283 lines
12 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"
|
|
// 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"
|
|
// FieldTemplateType holds the string denoting the template_type field in the database.
|
|
FieldTemplateType = "template_type"
|
|
// 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"
|
|
// FieldPendingAction holds the string denoting the pending_action field in the database.
|
|
FieldPendingAction = "pending_action"
|
|
// FieldPendingSince holds the string denoting the pending_since field in the database.
|
|
FieldPendingSince = "pending_since"
|
|
// 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,
|
|
FieldSourceDock,
|
|
FieldTargetDock,
|
|
FieldMaterialsJSON,
|
|
FieldRelatedRequestNo,
|
|
FieldRelatedOutboundNo,
|
|
FieldStatus,
|
|
FieldKind,
|
|
FieldBizType,
|
|
FieldBizNo,
|
|
FieldTemplateType,
|
|
FieldChainNo,
|
|
FieldAutoEnd,
|
|
FieldAgvCode,
|
|
FieldOperator,
|
|
FieldDispatchedAt,
|
|
FieldArrivedAt,
|
|
FieldPendingAction,
|
|
FieldPendingSince,
|
|
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
|
|
// 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
|
|
// DefaultTemplateType holds the default value on creation for the "template_type" field.
|
|
DefaultTemplateType string
|
|
// TemplateTypeValidator is a validator for the "template_type" field. It is called by the builders before save.
|
|
TemplateTypeValidator 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
|
|
// DefaultPendingAction holds the default value on creation for the "pending_action" field.
|
|
DefaultPendingAction string
|
|
// PendingActionValidator is a validator for the "pending_action" field. It is called by the builders before save.
|
|
PendingActionValidator func(string) error
|
|
// DefaultPendingSince holds the default value on creation for the "pending_since" field.
|
|
DefaultPendingSince 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()
|
|
}
|
|
|
|
// 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()
|
|
}
|
|
|
|
// ByTemplateType orders the results by the template_type field.
|
|
func ByTemplateType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTemplateType, 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()
|
|
}
|
|
|
|
// ByPendingAction orders the results by the pending_action field.
|
|
func ByPendingAction(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPendingAction, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPendingSince orders the results by the pending_since field.
|
|
func ByPendingSince(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPendingSince, 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()
|
|
}
|