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
+85
View File
@@ -173,6 +173,20 @@ func (_c *OutboundOrderCreate) SetNillableManageMode(v *int) *OutboundOrderCreat
return _c
}
// SetSnMode sets the "sn_mode" field.
func (_c *OutboundOrderCreate) SetSnMode(v int) *OutboundOrderCreate {
_c.mutation.SetSnMode(v)
return _c
}
// SetNillableSnMode sets the "sn_mode" field if the given value is not nil.
func (_c *OutboundOrderCreate) SetNillableSnMode(v *int) *OutboundOrderCreate {
if v != nil {
_c.SetSnMode(*v)
}
return _c
}
// SetBatchNo sets the "batch_no" field.
func (_c *OutboundOrderCreate) SetBatchNo(v string) *OutboundOrderCreate {
_c.mutation.SetBatchNo(v)
@@ -448,6 +462,10 @@ func (_c *OutboundOrderCreate) defaults() {
v := outboundorder.DefaultManageMode
_c.mutation.SetManageMode(v)
}
if _, ok := _c.mutation.SnMode(); !ok {
v := outboundorder.DefaultSnMode
_c.mutation.SetSnMode(v)
}
if _, ok := _c.mutation.Quantity(); !ok {
v := outboundorder.DefaultQuantity
_c.mutation.SetQuantity(v)
@@ -478,6 +496,9 @@ func (_c *OutboundOrderCreate) check() error {
if _, ok := _c.mutation.ManageMode(); !ok {
return &ValidationError{Name: "manage_mode", err: errors.New(`ent: missing required field "OutboundOrder.manage_mode"`)}
}
if _, ok := _c.mutation.SnMode(); !ok {
return &ValidationError{Name: "sn_mode", err: errors.New(`ent: missing required field "OutboundOrder.sn_mode"`)}
}
if _, ok := _c.mutation.Quantity(); !ok {
return &ValidationError{Name: "quantity", err: errors.New(`ent: missing required field "OutboundOrder.quantity"`)}
}
@@ -559,6 +580,10 @@ func (_c *OutboundOrderCreate) createSpec() (*OutboundOrder, *sqlgraph.CreateSpe
_spec.SetField(outboundorder.FieldManageMode, field.TypeInt, value)
_node.ManageMode = value
}
if value, ok := _c.mutation.SnMode(); ok {
_spec.SetField(outboundorder.FieldSnMode, field.TypeInt, value)
_node.SnMode = value
}
if value, ok := _c.mutation.BatchNo(); ok {
_spec.SetField(outboundorder.FieldBatchNo, field.TypeString, value)
_node.BatchNo = value
@@ -861,6 +886,24 @@ func (u *OutboundOrderUpsert) AddManageMode(v int) *OutboundOrderUpsert {
return u
}
// SetSnMode sets the "sn_mode" field.
func (u *OutboundOrderUpsert) SetSnMode(v int) *OutboundOrderUpsert {
u.Set(outboundorder.FieldSnMode, v)
return u
}
// UpdateSnMode sets the "sn_mode" field to the value that was provided on create.
func (u *OutboundOrderUpsert) UpdateSnMode() *OutboundOrderUpsert {
u.SetExcluded(outboundorder.FieldSnMode)
return u
}
// AddSnMode adds v to the "sn_mode" field.
func (u *OutboundOrderUpsert) AddSnMode(v int) *OutboundOrderUpsert {
u.Add(outboundorder.FieldSnMode, v)
return u
}
// SetBatchNo sets the "batch_no" field.
func (u *OutboundOrderUpsert) SetBatchNo(v string) *OutboundOrderUpsert {
u.Set(outboundorder.FieldBatchNo, v)
@@ -1406,6 +1449,27 @@ func (u *OutboundOrderUpsertOne) UpdateManageMode() *OutboundOrderUpsertOne {
})
}
// SetSnMode sets the "sn_mode" field.
func (u *OutboundOrderUpsertOne) SetSnMode(v int) *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.SetSnMode(v)
})
}
// AddSnMode adds v to the "sn_mode" field.
func (u *OutboundOrderUpsertOne) AddSnMode(v int) *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.AddSnMode(v)
})
}
// UpdateSnMode sets the "sn_mode" field to the value that was provided on create.
func (u *OutboundOrderUpsertOne) UpdateSnMode() *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.UpdateSnMode()
})
}
// SetBatchNo sets the "batch_no" field.
func (u *OutboundOrderUpsertOne) SetBatchNo(v string) *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
@@ -2163,6 +2227,27 @@ func (u *OutboundOrderUpsertBulk) UpdateManageMode() *OutboundOrderUpsertBulk {
})
}
// SetSnMode sets the "sn_mode" field.
func (u *OutboundOrderUpsertBulk) SetSnMode(v int) *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.SetSnMode(v)
})
}
// AddSnMode adds v to the "sn_mode" field.
func (u *OutboundOrderUpsertBulk) AddSnMode(v int) *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.AddSnMode(v)
})
}
// UpdateSnMode sets the "sn_mode" field to the value that was provided on create.
func (u *OutboundOrderUpsertBulk) UpdateSnMode() *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.UpdateSnMode()
})
}
// SetBatchNo sets the "batch_no" field.
func (u *OutboundOrderUpsertBulk) SetBatchNo(v string) *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {