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:
@@ -111,6 +111,104 @@ func (_u *AgvPointUpdate) SetNillableEnabled(v *bool) *AgvPointUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLocked sets the "locked" field.
|
||||
func (_u *AgvPointUpdate) SetLocked(v bool) *AgvPointUpdate {
|
||||
_u.mutation.SetLocked(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLocked sets the "locked" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableLocked(v *bool) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetLocked(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedBy sets the "locked_by" field.
|
||||
func (_u *AgvPointUpdate) SetLockedBy(v string) *AgvPointUpdate {
|
||||
_u.mutation.SetLockedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedBy sets the "locked_by" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableLockedBy(v *string) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetLockedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedReason sets the "locked_reason" field.
|
||||
func (_u *AgvPointUpdate) SetLockedReason(v string) *AgvPointUpdate {
|
||||
_u.mutation.SetLockedReason(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedReason sets the "locked_reason" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableLockedReason(v *string) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetLockedReason(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedAt sets the "locked_at" field.
|
||||
func (_u *AgvPointUpdate) SetLockedAt(v int64) *AgvPointUpdate {
|
||||
_u.mutation.ResetLockedAt()
|
||||
_u.mutation.SetLockedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedAt sets the "locked_at" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableLockedAt(v *int64) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetLockedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddLockedAt adds value to the "locked_at" field.
|
||||
func (_u *AgvPointUpdate) AddLockedAt(v int64) *AgvPointUpdate {
|
||||
_u.mutation.AddLockedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetForcePick sets the "force_pick" field.
|
||||
func (_u *AgvPointUpdate) SetForcePick(v bool) *AgvPointUpdate {
|
||||
_u.mutation.SetForcePick(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableForcePick sets the "force_pick" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableForcePick(v *bool) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetForcePick(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetForcePickAt sets the "force_pick_at" field.
|
||||
func (_u *AgvPointUpdate) SetForcePickAt(v int64) *AgvPointUpdate {
|
||||
_u.mutation.ResetForcePickAt()
|
||||
_u.mutation.SetForcePickAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableForcePickAt sets the "force_pick_at" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdate) SetNillableForcePickAt(v *int64) *AgvPointUpdate {
|
||||
if v != nil {
|
||||
_u.SetForcePickAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddForcePickAt adds value to the "force_pick_at" field.
|
||||
func (_u *AgvPointUpdate) AddForcePickAt(v int64) *AgvPointUpdate {
|
||||
_u.mutation.AddForcePickAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the AgvPointMutation object of the builder.
|
||||
func (_u *AgvPointUpdate) Mutation() *AgvPointMutation {
|
||||
return _u.mutation
|
||||
@@ -155,6 +253,16 @@ func (_u *AgvPointUpdate) check() error {
|
||||
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.name": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.LockedBy(); ok {
|
||||
if err := agvpoint.LockedByValidator(v); err != nil {
|
||||
return &ValidationError{Name: "locked_by", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.locked_by": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.LockedReason(); ok {
|
||||
if err := agvpoint.LockedReasonValidator(v); err != nil {
|
||||
return &ValidationError{Name: "locked_reason", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.locked_reason": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -197,6 +305,30 @@ func (_u *AgvPointUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if value, ok := _u.mutation.Enabled(); ok {
|
||||
_spec.SetField(agvpoint.FieldEnabled, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Locked(); ok {
|
||||
_spec.SetField(agvpoint.FieldLocked, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedBy(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedBy, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedReason(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedReason, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedAt(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedLockedAt(); ok {
|
||||
_spec.AddField(agvpoint.FieldLockedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ForcePick(); ok {
|
||||
_spec.SetField(agvpoint.FieldForcePick, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ForcePickAt(); ok {
|
||||
_spec.SetField(agvpoint.FieldForcePickAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedForcePickAt(); ok {
|
||||
_spec.AddField(agvpoint.FieldForcePickAt, field.TypeInt64, value)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
@@ -302,6 +434,104 @@ func (_u *AgvPointUpdateOne) SetNillableEnabled(v *bool) *AgvPointUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLocked sets the "locked" field.
|
||||
func (_u *AgvPointUpdateOne) SetLocked(v bool) *AgvPointUpdateOne {
|
||||
_u.mutation.SetLocked(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLocked sets the "locked" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableLocked(v *bool) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetLocked(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedBy sets the "locked_by" field.
|
||||
func (_u *AgvPointUpdateOne) SetLockedBy(v string) *AgvPointUpdateOne {
|
||||
_u.mutation.SetLockedBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedBy sets the "locked_by" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableLockedBy(v *string) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetLockedBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedReason sets the "locked_reason" field.
|
||||
func (_u *AgvPointUpdateOne) SetLockedReason(v string) *AgvPointUpdateOne {
|
||||
_u.mutation.SetLockedReason(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedReason sets the "locked_reason" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableLockedReason(v *string) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetLockedReason(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetLockedAt sets the "locked_at" field.
|
||||
func (_u *AgvPointUpdateOne) SetLockedAt(v int64) *AgvPointUpdateOne {
|
||||
_u.mutation.ResetLockedAt()
|
||||
_u.mutation.SetLockedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableLockedAt sets the "locked_at" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableLockedAt(v *int64) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetLockedAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddLockedAt adds value to the "locked_at" field.
|
||||
func (_u *AgvPointUpdateOne) AddLockedAt(v int64) *AgvPointUpdateOne {
|
||||
_u.mutation.AddLockedAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetForcePick sets the "force_pick" field.
|
||||
func (_u *AgvPointUpdateOne) SetForcePick(v bool) *AgvPointUpdateOne {
|
||||
_u.mutation.SetForcePick(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableForcePick sets the "force_pick" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableForcePick(v *bool) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetForcePick(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetForcePickAt sets the "force_pick_at" field.
|
||||
func (_u *AgvPointUpdateOne) SetForcePickAt(v int64) *AgvPointUpdateOne {
|
||||
_u.mutation.ResetForcePickAt()
|
||||
_u.mutation.SetForcePickAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableForcePickAt sets the "force_pick_at" field if the given value is not nil.
|
||||
func (_u *AgvPointUpdateOne) SetNillableForcePickAt(v *int64) *AgvPointUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetForcePickAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddForcePickAt adds value to the "force_pick_at" field.
|
||||
func (_u *AgvPointUpdateOne) AddForcePickAt(v int64) *AgvPointUpdateOne {
|
||||
_u.mutation.AddForcePickAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the AgvPointMutation object of the builder.
|
||||
func (_u *AgvPointUpdateOne) Mutation() *AgvPointMutation {
|
||||
return _u.mutation
|
||||
@@ -359,6 +589,16 @@ func (_u *AgvPointUpdateOne) check() error {
|
||||
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.name": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.LockedBy(); ok {
|
||||
if err := agvpoint.LockedByValidator(v); err != nil {
|
||||
return &ValidationError{Name: "locked_by", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.locked_by": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.LockedReason(); ok {
|
||||
if err := agvpoint.LockedReasonValidator(v); err != nil {
|
||||
return &ValidationError{Name: "locked_reason", err: fmt.Errorf(`ent: validator failed for field "AgvPoint.locked_reason": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -418,6 +658,30 @@ func (_u *AgvPointUpdateOne) sqlSave(ctx context.Context) (_node *AgvPoint, err
|
||||
if value, ok := _u.mutation.Enabled(); ok {
|
||||
_spec.SetField(agvpoint.FieldEnabled, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Locked(); ok {
|
||||
_spec.SetField(agvpoint.FieldLocked, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedBy(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedBy, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedReason(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedReason, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.LockedAt(); ok {
|
||||
_spec.SetField(agvpoint.FieldLockedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedLockedAt(); ok {
|
||||
_spec.AddField(agvpoint.FieldLockedAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ForcePick(); ok {
|
||||
_spec.SetField(agvpoint.FieldForcePick, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ForcePickAt(); ok {
|
||||
_spec.SetField(agvpoint.FieldForcePickAt, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedForcePickAt(); ok {
|
||||
_spec.AddField(agvpoint.FieldForcePickAt, field.TypeInt64, value)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
_node = &AgvPoint{config: _u.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
|
||||
Reference in New Issue
Block a user