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:
@@ -13,6 +13,8 @@ const (
|
||||
FieldID = "id"
|
||||
// FieldManageMode holds the string denoting the manage_mode field in the database.
|
||||
FieldManageMode = "manage_mode"
|
||||
// FieldSnMode holds the string denoting the sn_mode field in the database.
|
||||
FieldSnMode = "sn_mode"
|
||||
// FieldCategory holds the string denoting the category field in the database.
|
||||
FieldCategory = "category"
|
||||
// FieldMaterialCode holds the string denoting the material_code field in the database.
|
||||
@@ -83,6 +85,7 @@ const (
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldManageMode,
|
||||
FieldSnMode,
|
||||
FieldCategory,
|
||||
FieldMaterialCode,
|
||||
FieldMaterialName,
|
||||
@@ -127,6 +130,8 @@ func ValidColumn(column string) bool {
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultSnMode holds the default value on creation for the "sn_mode" field.
|
||||
DefaultSnMode int
|
||||
// DefaultCategory holds the default value on creation for the "category" field.
|
||||
DefaultCategory int
|
||||
// DefaultQuantity holds the default value on creation for the "quantity" field.
|
||||
@@ -168,6 +173,11 @@ func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySnMode orders the results by the sn_mode field.
|
||||
func BySnMode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSnMode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCategory orders the results by the category field.
|
||||
func ByCategory(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCategory, opts...).ToFunc()
|
||||
|
||||
@@ -58,6 +58,11 @@ func ManageMode(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldEQ(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// SnMode applies equality check predicate on the "sn_mode" field. It's identical to SnModeEQ.
|
||||
func SnMode(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// Category applies equality check predicate on the "category" field. It's identical to CategoryEQ.
|
||||
func Category(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldEQ(FieldCategory, v))
|
||||
@@ -253,6 +258,46 @@ func ManageModeLTE(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldLTE(FieldManageMode, v))
|
||||
}
|
||||
|
||||
// SnModeEQ applies the EQ predicate on the "sn_mode" field.
|
||||
func SnModeEQ(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// SnModeNEQ applies the NEQ predicate on the "sn_mode" field.
|
||||
func SnModeNEQ(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldNEQ(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// SnModeIn applies the In predicate on the "sn_mode" field.
|
||||
func SnModeIn(vs ...int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldIn(FieldSnMode, vs...))
|
||||
}
|
||||
|
||||
// SnModeNotIn applies the NotIn predicate on the "sn_mode" field.
|
||||
func SnModeNotIn(vs ...int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldNotIn(FieldSnMode, vs...))
|
||||
}
|
||||
|
||||
// SnModeGT applies the GT predicate on the "sn_mode" field.
|
||||
func SnModeGT(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldGT(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// SnModeGTE applies the GTE predicate on the "sn_mode" field.
|
||||
func SnModeGTE(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldGTE(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// SnModeLT applies the LT predicate on the "sn_mode" field.
|
||||
func SnModeLT(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldLT(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// SnModeLTE applies the LTE predicate on the "sn_mode" field.
|
||||
func SnModeLTE(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldLTE(FieldSnMode, v))
|
||||
}
|
||||
|
||||
// CategoryEQ applies the EQ predicate on the "category" field.
|
||||
func CategoryEQ(v int) predicate.Inventory {
|
||||
return predicate.Inventory(sql.FieldEQ(FieldCategory, v))
|
||||
|
||||
Reference in New Issue
Block a user