feat: 解耦管理类型与SN管理方式,新增sn_mode字段实现全链路SN管理标准化
本次重构将原manage_mode字段拆分为独立的分类维度(manage_mode)和SN管理维度(sn_mode),实现全链路(MES/WMS/工位终端)的SN管理行为统一依据: 1. 新增sn_mode字段,定义1=序列号件、2=批次件、0=未选择,替代原manage_mode的SN判断逻辑 2. 移除冗余的manage_mode字段在多个实体中的使用,统一使用sn_mode决定业务行为 3. 新增工位接驳台配置,服务端固定接驳台,前端不可修改,确保AGV送达准确性 4. 优化检验记录导出,新增装配物料绑定明细,满足客户追溯需求 5. 修正前端提示文本,统一使用序列号件/批次件表述,与后端逻辑对齐
This commit is contained in:
@@ -94,9 +94,9 @@ func Unit(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEQ(FieldUnit, v))
|
||||
}
|
||||
|
||||
// ManageMode applies equality check predicate on the "manageMode" field. It's identical to ManageModeEQ.
|
||||
func ManageMode(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEQ(FieldManageMode, v))
|
||||
// SnMode applies equality check predicate on the "snMode" field. It's identical to SnModeEQ.
|
||||
func SnMode(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// BindValue applies equality check predicate on the "bindValue" field. It's identical to BindValueEQ.
|
||||
@@ -614,69 +614,44 @@ func UnitContainsFold(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldContainsFold(FieldUnit, v))
|
||||
}
|
||||
|
||||
// ManageModeEQ applies the EQ predicate on the "manageMode" field.
|
||||
func ManageModeEQ(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEQ(FieldManageMode, v))
|
||||
// SnModeEQ applies the EQ predicate on the "snMode" field.
|
||||
func SnModeEQ(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// ManageModeNEQ applies the NEQ predicate on the "manageMode" field.
|
||||
func ManageModeNEQ(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldNEQ(FieldManageMode, v))
|
||||
// SnModeNEQ applies the NEQ predicate on the "snMode" field.
|
||||
func SnModeNEQ(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldNEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// ManageModeIn applies the In predicate on the "manageMode" field.
|
||||
func ManageModeIn(vs ...string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldIn(FieldManageMode, vs...))
|
||||
// SnModeIn applies the In predicate on the "snMode" field.
|
||||
func SnModeIn(vs ...int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldIn(FieldSnMode, vs...))
|
||||
}
|
||||
|
||||
// ManageModeNotIn applies the NotIn predicate on the "manageMode" field.
|
||||
func ManageModeNotIn(vs ...string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldNotIn(FieldManageMode, vs...))
|
||||
// SnModeNotIn applies the NotIn predicate on the "snMode" field.
|
||||
func SnModeNotIn(vs ...int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldNotIn(FieldSnMode, vs...))
|
||||
}
|
||||
|
||||
// ManageModeGT applies the GT predicate on the "manageMode" field.
|
||||
func ManageModeGT(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldGT(FieldManageMode, v))
|
||||
// SnModeGT applies the GT predicate on the "snMode" field.
|
||||
func SnModeGT(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldGT(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// ManageModeGTE applies the GTE predicate on the "manageMode" field.
|
||||
func ManageModeGTE(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldGTE(FieldManageMode, v))
|
||||
// SnModeGTE applies the GTE predicate on the "snMode" field.
|
||||
func SnModeGTE(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldGTE(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// ManageModeLT applies the LT predicate on the "manageMode" field.
|
||||
func ManageModeLT(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldLT(FieldManageMode, v))
|
||||
// SnModeLT applies the LT predicate on the "snMode" field.
|
||||
func SnModeLT(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldLT(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// ManageModeLTE applies the LTE predicate on the "manageMode" field.
|
||||
func ManageModeLTE(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldLTE(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// ManageModeContains applies the Contains predicate on the "manageMode" field.
|
||||
func ManageModeContains(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldContains(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// ManageModeHasPrefix applies the HasPrefix predicate on the "manageMode" field.
|
||||
func ManageModeHasPrefix(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldHasPrefix(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// ManageModeHasSuffix applies the HasSuffix predicate on the "manageMode" field.
|
||||
func ManageModeHasSuffix(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldHasSuffix(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// ManageModeEqualFold applies the EqualFold predicate on the "manageMode" field.
|
||||
func ManageModeEqualFold(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldEqualFold(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// ManageModeContainsFold applies the ContainsFold predicate on the "manageMode" field.
|
||||
func ManageModeContainsFold(v string) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldContainsFold(FieldManageMode, v))
|
||||
// SnModeLTE applies the LTE predicate on the "snMode" field.
|
||||
func SnModeLTE(v int) predicate.WorkpieceBind {
|
||||
return predicate.WorkpieceBind(sql.FieldLTE(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// BindValueEQ applies the EQ predicate on the "bindValue" field.
|
||||
|
||||
@@ -29,8 +29,8 @@ const (
|
||||
FieldSpec = "spec"
|
||||
// FieldUnit holds the string denoting the unit field in the database.
|
||||
FieldUnit = "unit"
|
||||
// FieldManageMode holds the string denoting the managemode field in the database.
|
||||
FieldManageMode = "manage_mode"
|
||||
// FieldSnMode holds the string denoting the snmode field in the database.
|
||||
FieldSnMode = "sn_mode"
|
||||
// FieldBindValue holds the string denoting the bindvalue field in the database.
|
||||
FieldBindValue = "bind_value"
|
||||
// FieldBindType holds the string denoting the bindtype field in the database.
|
||||
@@ -54,7 +54,7 @@ var Columns = []string{
|
||||
FieldMaterialName,
|
||||
FieldSpec,
|
||||
FieldUnit,
|
||||
FieldManageMode,
|
||||
FieldSnMode,
|
||||
FieldBindValue,
|
||||
FieldBindType,
|
||||
FieldOperator,
|
||||
@@ -96,10 +96,8 @@ var (
|
||||
DefaultUnit string
|
||||
// UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||||
UnitValidator func(string) error
|
||||
// DefaultManageMode holds the default value on creation for the "manageMode" field.
|
||||
DefaultManageMode string
|
||||
// ManageModeValidator is a validator for the "manageMode" field. It is called by the builders before save.
|
||||
ManageModeValidator func(string) error
|
||||
// DefaultSnMode holds the default value on creation for the "snMode" field.
|
||||
DefaultSnMode int
|
||||
// BindValueValidator is a validator for the "bindValue" field. It is called by the builders before save.
|
||||
BindValueValidator func(string) error
|
||||
// DefaultBindType holds the default value on creation for the "bindType" field.
|
||||
@@ -164,9 +162,9 @@ func ByUnit(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUnit, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByManageMode orders the results by the manageMode field.
|
||||
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
|
||||
// BySnMode orders the results by the snMode field.
|
||||
func BySnMode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSnMode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByBindValue orders the results by the bindValue field.
|
||||
|
||||
Reference in New Issue
Block a user