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
+12 -12
View File
@@ -13,8 +13,6 @@ const (
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.
@@ -33,6 +31,8 @@ const (
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.
@@ -57,7 +57,6 @@ const (
var Columns = []string{
FieldID,
FieldTaskNo,
FieldHikTaskCode,
FieldSourceDock,
FieldTargetDock,
FieldMaterialsJSON,
@@ -67,6 +66,7 @@ var Columns = []string{
FieldKind,
FieldBizType,
FieldBizNo,
FieldTemplateType,
FieldChainNo,
FieldAutoEnd,
FieldAgvCode,
@@ -90,10 +90,6 @@ func ValidColumn(column string) bool {
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.
@@ -130,6 +126,10 @@ var (
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.
@@ -169,11 +169,6 @@ 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()
@@ -219,6 +214,11 @@ 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()
+70 -70
View File
@@ -58,11 +58,6 @@ func TaskNo(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldTaskNo, v))
}
// HikTaskCode applies equality check predicate on the "hik_task_code" field. It's identical to HikTaskCodeEQ.
func HikTaskCode(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldHikTaskCode, v))
}
// SourceDock applies equality check predicate on the "source_dock" field. It's identical to SourceDockEQ.
func SourceDock(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldSourceDock, v))
@@ -108,6 +103,11 @@ func BizNo(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldBizNo, v))
}
// TemplateType applies equality check predicate on the "template_type" field. It's identical to TemplateTypeEQ.
func TemplateType(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldTemplateType, v))
}
// ChainNo applies equality check predicate on the "chain_no" field. It's identical to ChainNoEQ.
func ChainNo(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldChainNo, v))
@@ -213,71 +213,6 @@ func TaskNoContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldTaskNo, v))
}
// HikTaskCodeEQ applies the EQ predicate on the "hik_task_code" field.
func HikTaskCodeEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldHikTaskCode, v))
}
// HikTaskCodeNEQ applies the NEQ predicate on the "hik_task_code" field.
func HikTaskCodeNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldHikTaskCode, v))
}
// HikTaskCodeIn applies the In predicate on the "hik_task_code" field.
func HikTaskCodeIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldHikTaskCode, vs...))
}
// HikTaskCodeNotIn applies the NotIn predicate on the "hik_task_code" field.
func HikTaskCodeNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldHikTaskCode, vs...))
}
// HikTaskCodeGT applies the GT predicate on the "hik_task_code" field.
func HikTaskCodeGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldHikTaskCode, v))
}
// HikTaskCodeGTE applies the GTE predicate on the "hik_task_code" field.
func HikTaskCodeGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldHikTaskCode, v))
}
// HikTaskCodeLT applies the LT predicate on the "hik_task_code" field.
func HikTaskCodeLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldHikTaskCode, v))
}
// HikTaskCodeLTE applies the LTE predicate on the "hik_task_code" field.
func HikTaskCodeLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldHikTaskCode, v))
}
// HikTaskCodeContains applies the Contains predicate on the "hik_task_code" field.
func HikTaskCodeContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldHikTaskCode, v))
}
// HikTaskCodeHasPrefix applies the HasPrefix predicate on the "hik_task_code" field.
func HikTaskCodeHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldHikTaskCode, v))
}
// HikTaskCodeHasSuffix applies the HasSuffix predicate on the "hik_task_code" field.
func HikTaskCodeHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldHikTaskCode, v))
}
// HikTaskCodeEqualFold applies the EqualFold predicate on the "hik_task_code" field.
func HikTaskCodeEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldHikTaskCode, v))
}
// HikTaskCodeContainsFold applies the ContainsFold predicate on the "hik_task_code" field.
func HikTaskCodeContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldHikTaskCode, v))
}
// SourceDockEQ applies the EQ predicate on the "source_dock" field.
func SourceDockEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldSourceDock, v))
@@ -883,6 +818,71 @@ func BizNoContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldBizNo, v))
}
// TemplateTypeEQ applies the EQ predicate on the "template_type" field.
func TemplateTypeEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldTemplateType, v))
}
// TemplateTypeNEQ applies the NEQ predicate on the "template_type" field.
func TemplateTypeNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldTemplateType, v))
}
// TemplateTypeIn applies the In predicate on the "template_type" field.
func TemplateTypeIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldTemplateType, vs...))
}
// TemplateTypeNotIn applies the NotIn predicate on the "template_type" field.
func TemplateTypeNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldTemplateType, vs...))
}
// TemplateTypeGT applies the GT predicate on the "template_type" field.
func TemplateTypeGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldTemplateType, v))
}
// TemplateTypeGTE applies the GTE predicate on the "template_type" field.
func TemplateTypeGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldTemplateType, v))
}
// TemplateTypeLT applies the LT predicate on the "template_type" field.
func TemplateTypeLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldTemplateType, v))
}
// TemplateTypeLTE applies the LTE predicate on the "template_type" field.
func TemplateTypeLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldTemplateType, v))
}
// TemplateTypeContains applies the Contains predicate on the "template_type" field.
func TemplateTypeContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldTemplateType, v))
}
// TemplateTypeHasPrefix applies the HasPrefix predicate on the "template_type" field.
func TemplateTypeHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldTemplateType, v))
}
// TemplateTypeHasSuffix applies the HasSuffix predicate on the "template_type" field.
func TemplateTypeHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldTemplateType, v))
}
// TemplateTypeEqualFold applies the EqualFold predicate on the "template_type" field.
func TemplateTypeEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldTemplateType, v))
}
// TemplateTypeContainsFold applies the ContainsFold predicate on the "template_type" field.
func TemplateTypeContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldTemplateType, v))
}
// ChainNoEQ applies the EQ predicate on the "chain_no" field.
func ChainNoEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldChainNo, v))