feat: AGV点位锁与缓存迁移 + 工位终端去离线队列 + WMS出入库增强

【MES】
- AGV点位/线路点位/AGV任务/工单 ent schema 重构(全量重生成 ent 代码)
- 新增派车锁 agv_point_lock.go:目标点位占用即拒车,JBT21 库房接驳台卸货后保持锁定待库管手动解锁
- 新增进程内 TTL 缓存 cache.go,由 Redis 看板缓存迁移至内存(singleflight 防击穿,去除外部依赖)
- AGV 三段链安全机制、车辆状态/接驳台左右互换、补料损耗闭环完善
- 来料检/工序卡/工单/质检/日排产/AGV 前端与帮助文档更新
- 新增 migrations/、sql/ 目录

【WMS】
- 出库、Excel 导出、物料、路由处理增强
- 配置与 DB 初始化调整;基础数据/成品入库/入库前端调整

【工位终端】
- 移除离线同步队列(syncer 包、sync.go、SyncQueueDialog.vue),改为实时直连上报 MES(断网即失败报错),以本人身份操作
- 本地 SQLite 仅保留操作日志 + 内置账号 + 登录态;保留空闲自动登出

【文档】
- 删除 AGV海康litev1.5.md;案例.md 更新
This commit is contained in:
SunYF
2026-11-07 15:06:00 +08:00
parent 1d1dc1bdd8
commit 5e2640c13a
118 changed files with 4040 additions and 3594 deletions
+64
View File
@@ -23,6 +23,18 @@ const (
FieldDockID = "dock_id"
// FieldEnabled holds the string denoting the enabled field in the database.
FieldEnabled = "enabled"
// FieldLocked holds the string denoting the locked field in the database.
FieldLocked = "locked"
// FieldLockedBy holds the string denoting the locked_by field in the database.
FieldLockedBy = "locked_by"
// FieldLockedReason holds the string denoting the locked_reason field in the database.
FieldLockedReason = "locked_reason"
// FieldLockedAt holds the string denoting the locked_at field in the database.
FieldLockedAt = "locked_at"
// FieldForcePick holds the string denoting the force_pick field in the database.
FieldForcePick = "force_pick"
// FieldForcePickAt holds the string denoting the force_pick_at field in the database.
FieldForcePickAt = "force_pick_at"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the agvpoint in the database.
@@ -37,6 +49,12 @@ var Columns = []string{
FieldIsDock,
FieldDockID,
FieldEnabled,
FieldLocked,
FieldLockedBy,
FieldLockedReason,
FieldLockedAt,
FieldForcePick,
FieldForcePickAt,
FieldCreatedAt,
}
@@ -61,6 +79,22 @@ var (
DefaultIsDock bool
// DefaultEnabled holds the default value on creation for the "enabled" field.
DefaultEnabled bool
// DefaultLocked holds the default value on creation for the "locked" field.
DefaultLocked bool
// DefaultLockedBy holds the default value on creation for the "locked_by" field.
DefaultLockedBy string
// LockedByValidator is a validator for the "locked_by" field. It is called by the builders before save.
LockedByValidator func(string) error
// DefaultLockedReason holds the default value on creation for the "locked_reason" field.
DefaultLockedReason string
// LockedReasonValidator is a validator for the "locked_reason" field. It is called by the builders before save.
LockedReasonValidator func(string) error
// DefaultLockedAt holds the default value on creation for the "locked_at" field.
DefaultLockedAt int64
// DefaultForcePick holds the default value on creation for the "force_pick" field.
DefaultForcePick bool
// DefaultForcePickAt holds the default value on creation for the "force_pick_at" field.
DefaultForcePickAt int64
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
)
@@ -98,6 +132,36 @@ func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEnabled, opts...).ToFunc()
}
// ByLocked orders the results by the locked field.
func ByLocked(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLocked, opts...).ToFunc()
}
// ByLockedBy orders the results by the locked_by field.
func ByLockedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLockedBy, opts...).ToFunc()
}
// ByLockedReason orders the results by the locked_reason field.
func ByLockedReason(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLockedReason, opts...).ToFunc()
}
// ByLockedAt orders the results by the locked_at field.
func ByLockedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLockedAt, opts...).ToFunc()
}
// ByForcePick orders the results by the force_pick field.
func ByForcePick(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldForcePick, opts...).ToFunc()
}
// ByForcePickAt orders the results by the force_pick_at field.
func ByForcePickAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldForcePickAt, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+260
View File
@@ -79,6 +79,36 @@ func Enabled(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldEnabled, v))
}
// Locked applies equality check predicate on the "locked" field. It's identical to LockedEQ.
func Locked(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLocked, v))
}
// LockedBy applies equality check predicate on the "locked_by" field. It's identical to LockedByEQ.
func LockedBy(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedBy, v))
}
// LockedReason applies equality check predicate on the "locked_reason" field. It's identical to LockedReasonEQ.
func LockedReason(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedReason, v))
}
// LockedAt applies equality check predicate on the "locked_at" field. It's identical to LockedAtEQ.
func LockedAt(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedAt, v))
}
// ForcePick applies equality check predicate on the "force_pick" field. It's identical to ForcePickEQ.
func ForcePick(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldForcePick, v))
}
// ForcePickAt applies equality check predicate on the "force_pick_at" field. It's identical to ForcePickAtEQ.
func ForcePickAt(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldForcePickAt, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldCreatedAt, v))
@@ -284,6 +314,236 @@ func EnabledNEQ(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldEnabled, v))
}
// LockedEQ applies the EQ predicate on the "locked" field.
func LockedEQ(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLocked, v))
}
// LockedNEQ applies the NEQ predicate on the "locked" field.
func LockedNEQ(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldLocked, v))
}
// LockedByEQ applies the EQ predicate on the "locked_by" field.
func LockedByEQ(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedBy, v))
}
// LockedByNEQ applies the NEQ predicate on the "locked_by" field.
func LockedByNEQ(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldLockedBy, v))
}
// LockedByIn applies the In predicate on the "locked_by" field.
func LockedByIn(vs ...string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldIn(FieldLockedBy, vs...))
}
// LockedByNotIn applies the NotIn predicate on the "locked_by" field.
func LockedByNotIn(vs ...string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNotIn(FieldLockedBy, vs...))
}
// LockedByGT applies the GT predicate on the "locked_by" field.
func LockedByGT(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGT(FieldLockedBy, v))
}
// LockedByGTE applies the GTE predicate on the "locked_by" field.
func LockedByGTE(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGTE(FieldLockedBy, v))
}
// LockedByLT applies the LT predicate on the "locked_by" field.
func LockedByLT(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLT(FieldLockedBy, v))
}
// LockedByLTE applies the LTE predicate on the "locked_by" field.
func LockedByLTE(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLTE(FieldLockedBy, v))
}
// LockedByContains applies the Contains predicate on the "locked_by" field.
func LockedByContains(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldContains(FieldLockedBy, v))
}
// LockedByHasPrefix applies the HasPrefix predicate on the "locked_by" field.
func LockedByHasPrefix(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldHasPrefix(FieldLockedBy, v))
}
// LockedByHasSuffix applies the HasSuffix predicate on the "locked_by" field.
func LockedByHasSuffix(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldHasSuffix(FieldLockedBy, v))
}
// LockedByEqualFold applies the EqualFold predicate on the "locked_by" field.
func LockedByEqualFold(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEqualFold(FieldLockedBy, v))
}
// LockedByContainsFold applies the ContainsFold predicate on the "locked_by" field.
func LockedByContainsFold(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldContainsFold(FieldLockedBy, v))
}
// LockedReasonEQ applies the EQ predicate on the "locked_reason" field.
func LockedReasonEQ(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedReason, v))
}
// LockedReasonNEQ applies the NEQ predicate on the "locked_reason" field.
func LockedReasonNEQ(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldLockedReason, v))
}
// LockedReasonIn applies the In predicate on the "locked_reason" field.
func LockedReasonIn(vs ...string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldIn(FieldLockedReason, vs...))
}
// LockedReasonNotIn applies the NotIn predicate on the "locked_reason" field.
func LockedReasonNotIn(vs ...string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNotIn(FieldLockedReason, vs...))
}
// LockedReasonGT applies the GT predicate on the "locked_reason" field.
func LockedReasonGT(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGT(FieldLockedReason, v))
}
// LockedReasonGTE applies the GTE predicate on the "locked_reason" field.
func LockedReasonGTE(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGTE(FieldLockedReason, v))
}
// LockedReasonLT applies the LT predicate on the "locked_reason" field.
func LockedReasonLT(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLT(FieldLockedReason, v))
}
// LockedReasonLTE applies the LTE predicate on the "locked_reason" field.
func LockedReasonLTE(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLTE(FieldLockedReason, v))
}
// LockedReasonContains applies the Contains predicate on the "locked_reason" field.
func LockedReasonContains(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldContains(FieldLockedReason, v))
}
// LockedReasonHasPrefix applies the HasPrefix predicate on the "locked_reason" field.
func LockedReasonHasPrefix(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldHasPrefix(FieldLockedReason, v))
}
// LockedReasonHasSuffix applies the HasSuffix predicate on the "locked_reason" field.
func LockedReasonHasSuffix(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldHasSuffix(FieldLockedReason, v))
}
// LockedReasonEqualFold applies the EqualFold predicate on the "locked_reason" field.
func LockedReasonEqualFold(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEqualFold(FieldLockedReason, v))
}
// LockedReasonContainsFold applies the ContainsFold predicate on the "locked_reason" field.
func LockedReasonContainsFold(v string) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldContainsFold(FieldLockedReason, v))
}
// LockedAtEQ applies the EQ predicate on the "locked_at" field.
func LockedAtEQ(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldLockedAt, v))
}
// LockedAtNEQ applies the NEQ predicate on the "locked_at" field.
func LockedAtNEQ(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldLockedAt, v))
}
// LockedAtIn applies the In predicate on the "locked_at" field.
func LockedAtIn(vs ...int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldIn(FieldLockedAt, vs...))
}
// LockedAtNotIn applies the NotIn predicate on the "locked_at" field.
func LockedAtNotIn(vs ...int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNotIn(FieldLockedAt, vs...))
}
// LockedAtGT applies the GT predicate on the "locked_at" field.
func LockedAtGT(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGT(FieldLockedAt, v))
}
// LockedAtGTE applies the GTE predicate on the "locked_at" field.
func LockedAtGTE(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGTE(FieldLockedAt, v))
}
// LockedAtLT applies the LT predicate on the "locked_at" field.
func LockedAtLT(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLT(FieldLockedAt, v))
}
// LockedAtLTE applies the LTE predicate on the "locked_at" field.
func LockedAtLTE(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLTE(FieldLockedAt, v))
}
// ForcePickEQ applies the EQ predicate on the "force_pick" field.
func ForcePickEQ(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldForcePick, v))
}
// ForcePickNEQ applies the NEQ predicate on the "force_pick" field.
func ForcePickNEQ(v bool) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldForcePick, v))
}
// ForcePickAtEQ applies the EQ predicate on the "force_pick_at" field.
func ForcePickAtEQ(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldForcePickAt, v))
}
// ForcePickAtNEQ applies the NEQ predicate on the "force_pick_at" field.
func ForcePickAtNEQ(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNEQ(FieldForcePickAt, v))
}
// ForcePickAtIn applies the In predicate on the "force_pick_at" field.
func ForcePickAtIn(vs ...int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldIn(FieldForcePickAt, vs...))
}
// ForcePickAtNotIn applies the NotIn predicate on the "force_pick_at" field.
func ForcePickAtNotIn(vs ...int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldNotIn(FieldForcePickAt, vs...))
}
// ForcePickAtGT applies the GT predicate on the "force_pick_at" field.
func ForcePickAtGT(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGT(FieldForcePickAt, v))
}
// ForcePickAtGTE applies the GTE predicate on the "force_pick_at" field.
func ForcePickAtGTE(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldGTE(FieldForcePickAt, v))
}
// ForcePickAtLT applies the LT predicate on the "force_pick_at" field.
func ForcePickAtLT(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLT(FieldForcePickAt, v))
}
// ForcePickAtLTE applies the LTE predicate on the "force_pick_at" field.
func ForcePickAtLTE(v int64) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldLTE(FieldForcePickAt, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.AgvPoint {
return predicate.AgvPoint(sql.FieldEQ(FieldCreatedAt, v))