feat: 多系统新增扫码中间件与 AGV 对接,优化拧紧与退库流程
新增扫码中间件支持网络型扫码枪键盘注入,AGV 对接从 WMS 迁至 MES 统一管理;新增拧紧不合格人工处置与 PLC 对账机制,优化退库单关联与工位终端功能,同时清理旧 AGV 任务表,完善数据库与配置项。
This commit is contained in:
@@ -204,6 +204,60 @@ func (_u *WorkpieceUpdate) ClearUpdatedAt() *WorkpieceUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgPending sets the "torque_ng_pending" field.
|
||||
func (_u *WorkpieceUpdate) SetTorqueNgPending(v bool) *WorkpieceUpdate {
|
||||
_u.mutation.SetTorqueNgPending(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgPending sets the "torque_ng_pending" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdate) SetNillableTorqueNgPending(v *bool) *WorkpieceUpdate {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgPending(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgAt sets the "torque_ng_at" field.
|
||||
func (_u *WorkpieceUpdate) SetTorqueNgAt(v time.Time) *WorkpieceUpdate {
|
||||
_u.mutation.SetTorqueNgAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgAt sets the "torque_ng_at" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdate) SetNillableTorqueNgAt(v *time.Time) *WorkpieceUpdate {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearTorqueNgAt clears the value of the "torque_ng_at" field.
|
||||
func (_u *WorkpieceUpdate) ClearTorqueNgAt() *WorkpieceUpdate {
|
||||
_u.mutation.ClearTorqueNgAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgBy sets the "torque_ng_by" field.
|
||||
func (_u *WorkpieceUpdate) SetTorqueNgBy(v string) *WorkpieceUpdate {
|
||||
_u.mutation.SetTorqueNgBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgBy sets the "torque_ng_by" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdate) SetNillableTorqueNgBy(v *string) *WorkpieceUpdate {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearTorqueNgBy clears the value of the "torque_ng_by" field.
|
||||
func (_u *WorkpieceUpdate) ClearTorqueNgBy() *WorkpieceUpdate {
|
||||
_u.mutation.ClearTorqueNgBy()
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the WorkpieceMutation object of the builder.
|
||||
func (_u *WorkpieceUpdate) Mutation() *WorkpieceMutation {
|
||||
return _u.mutation
|
||||
@@ -262,6 +316,11 @@ func (_u *WorkpieceUpdate) check() error {
|
||||
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Workpiece.status": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.TorqueNgBy(); ok {
|
||||
if err := workpiece.TorqueNgByValidator(v); err != nil {
|
||||
return &ValidationError{Name: "torque_ng_by", err: fmt.Errorf(`ent: validator failed for field "Workpiece.torque_ng_by": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -337,6 +396,21 @@ func (_u *WorkpieceUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.UpdatedAtCleared() {
|
||||
_spec.ClearField(workpiece.FieldUpdatedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgPending(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgPending, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgAt(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgAt, field.TypeTime, value)
|
||||
}
|
||||
if _u.mutation.TorqueNgAtCleared() {
|
||||
_spec.ClearField(workpiece.FieldTorqueNgAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgBy(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgBy, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.TorqueNgByCleared() {
|
||||
_spec.ClearField(workpiece.FieldTorqueNgBy, field.TypeString)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
@@ -534,6 +608,60 @@ func (_u *WorkpieceUpdateOne) ClearUpdatedAt() *WorkpieceUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgPending sets the "torque_ng_pending" field.
|
||||
func (_u *WorkpieceUpdateOne) SetTorqueNgPending(v bool) *WorkpieceUpdateOne {
|
||||
_u.mutation.SetTorqueNgPending(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgPending sets the "torque_ng_pending" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdateOne) SetNillableTorqueNgPending(v *bool) *WorkpieceUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgPending(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgAt sets the "torque_ng_at" field.
|
||||
func (_u *WorkpieceUpdateOne) SetTorqueNgAt(v time.Time) *WorkpieceUpdateOne {
|
||||
_u.mutation.SetTorqueNgAt(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgAt sets the "torque_ng_at" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdateOne) SetNillableTorqueNgAt(v *time.Time) *WorkpieceUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgAt(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearTorqueNgAt clears the value of the "torque_ng_at" field.
|
||||
func (_u *WorkpieceUpdateOne) ClearTorqueNgAt() *WorkpieceUpdateOne {
|
||||
_u.mutation.ClearTorqueNgAt()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetTorqueNgBy sets the "torque_ng_by" field.
|
||||
func (_u *WorkpieceUpdateOne) SetTorqueNgBy(v string) *WorkpieceUpdateOne {
|
||||
_u.mutation.SetTorqueNgBy(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableTorqueNgBy sets the "torque_ng_by" field if the given value is not nil.
|
||||
func (_u *WorkpieceUpdateOne) SetNillableTorqueNgBy(v *string) *WorkpieceUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetTorqueNgBy(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearTorqueNgBy clears the value of the "torque_ng_by" field.
|
||||
func (_u *WorkpieceUpdateOne) ClearTorqueNgBy() *WorkpieceUpdateOne {
|
||||
_u.mutation.ClearTorqueNgBy()
|
||||
return _u
|
||||
}
|
||||
|
||||
// Mutation returns the WorkpieceMutation object of the builder.
|
||||
func (_u *WorkpieceUpdateOne) Mutation() *WorkpieceMutation {
|
||||
return _u.mutation
|
||||
@@ -605,6 +733,11 @@ func (_u *WorkpieceUpdateOne) check() error {
|
||||
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Workpiece.status": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.TorqueNgBy(); ok {
|
||||
if err := workpiece.TorqueNgByValidator(v); err != nil {
|
||||
return &ValidationError{Name: "torque_ng_by", err: fmt.Errorf(`ent: validator failed for field "Workpiece.torque_ng_by": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -697,6 +830,21 @@ func (_u *WorkpieceUpdateOne) sqlSave(ctx context.Context) (_node *Workpiece, er
|
||||
if _u.mutation.UpdatedAtCleared() {
|
||||
_spec.ClearField(workpiece.FieldUpdatedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgPending(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgPending, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgAt(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgAt, field.TypeTime, value)
|
||||
}
|
||||
if _u.mutation.TorqueNgAtCleared() {
|
||||
_spec.ClearField(workpiece.FieldTorqueNgAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.TorqueNgBy(); ok {
|
||||
_spec.SetField(workpiece.FieldTorqueNgBy, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.TorqueNgByCleared() {
|
||||
_spec.ClearField(workpiece.FieldTorqueNgBy, field.TypeString)
|
||||
}
|
||||
_spec.AddModifiers(_u.modifiers...)
|
||||
_node = &Workpiece{config: _u.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
|
||||
Reference in New Issue
Block a user