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:
SunYF
2026-09-30 17:33:11 +08:00
parent 58f67240d7
commit c33acab9c8
136 changed files with 3730 additions and 1174 deletions
+10
View File
@@ -27,6 +27,8 @@ const (
FieldItemType = "item_type"
// 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"
// FieldTemplateCode holds the string denoting the templatecode field in the database.
FieldTemplateCode = "template_code"
// FieldSafetyStock holds the string denoting the safetystock field in the database.
@@ -53,6 +55,7 @@ var Columns = []string{
FieldDescription,
FieldItemType,
FieldManageMode,
FieldSnMode,
FieldTemplateCode,
FieldSafetyStock,
FieldIsActive,
@@ -92,6 +95,8 @@ var (
DefaultItemType int
// DefaultManageMode holds the default value on creation for the "manageMode" field.
DefaultManageMode int
// DefaultSnMode holds the default value on creation for the "snMode" field.
DefaultSnMode int
// DefaultTemplateCode holds the default value on creation for the "templateCode" field.
DefaultTemplateCode string
// TemplateCodeValidator is a validator for the "templateCode" field. It is called by the builders before save.
@@ -153,6 +158,11 @@ 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()
}
// ByTemplateCode orders the results by the templateCode field.
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
+45
View File
@@ -89,6 +89,11 @@ func ManageMode(v int) predicate.Material {
return predicate.Material(sql.FieldEQ(FieldManageMode, v))
}
// SnMode applies equality check predicate on the "snMode" field. It's identical to SnModeEQ.
func SnMode(v int) predicate.Material {
return predicate.Material(sql.FieldEQ(FieldSnMode, v))
}
// TemplateCode applies equality check predicate on the "templateCode" field. It's identical to TemplateCodeEQ.
func TemplateCode(v string) predicate.Material {
return predicate.Material(sql.FieldEQ(FieldTemplateCode, v))
@@ -524,6 +529,46 @@ func ManageModeLTE(v int) predicate.Material {
return predicate.Material(sql.FieldLTE(FieldManageMode, v))
}
// SnModeEQ applies the EQ predicate on the "snMode" field.
func SnModeEQ(v int) predicate.Material {
return predicate.Material(sql.FieldEQ(FieldSnMode, v))
}
// SnModeNEQ applies the NEQ predicate on the "snMode" field.
func SnModeNEQ(v int) predicate.Material {
return predicate.Material(sql.FieldNEQ(FieldSnMode, v))
}
// SnModeIn applies the In predicate on the "snMode" field.
func SnModeIn(vs ...int) predicate.Material {
return predicate.Material(sql.FieldIn(FieldSnMode, vs...))
}
// SnModeNotIn applies the NotIn predicate on the "snMode" field.
func SnModeNotIn(vs ...int) predicate.Material {
return predicate.Material(sql.FieldNotIn(FieldSnMode, vs...))
}
// SnModeGT applies the GT predicate on the "snMode" field.
func SnModeGT(v int) predicate.Material {
return predicate.Material(sql.FieldGT(FieldSnMode, v))
}
// SnModeGTE applies the GTE predicate on the "snMode" field.
func SnModeGTE(v int) predicate.Material {
return predicate.Material(sql.FieldGTE(FieldSnMode, v))
}
// SnModeLT applies the LT predicate on the "snMode" field.
func SnModeLT(v int) predicate.Material {
return predicate.Material(sql.FieldLT(FieldSnMode, v))
}
// SnModeLTE applies the LTE predicate on the "snMode" field.
func SnModeLTE(v int) predicate.Material {
return predicate.Material(sql.FieldLTE(FieldSnMode, v))
}
// TemplateCodeEQ applies the EQ predicate on the "templateCode" field.
func TemplateCodeEQ(v string) predicate.Material {
return predicate.Material(sql.FieldEQ(FieldTemplateCode, v))