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
+38 -22
View File
@@ -167,20 +167,24 @@ func init() {
inboundorderDescManageMode := inboundorderFields[4].Descriptor()
// inboundorder.DefaultManageMode holds the default value on creation for the manage_mode field.
inboundorder.DefaultManageMode = inboundorderDescManageMode.Default.(int)
// inboundorderDescSnMode is the schema descriptor for sn_mode field.
inboundorderDescSnMode := inboundorderFields[5].Descriptor()
// inboundorder.DefaultSnMode holds the default value on creation for the sn_mode field.
inboundorder.DefaultSnMode = inboundorderDescSnMode.Default.(int)
// inboundorderDescQuantity is the schema descriptor for quantity field.
inboundorderDescQuantity := inboundorderFields[10].Descriptor()
inboundorderDescQuantity := inboundorderFields[11].Descriptor()
// inboundorder.DefaultQuantity holds the default value on creation for the quantity field.
inboundorder.DefaultQuantity = inboundorderDescQuantity.Default.(int)
// inboundorderDescOwnershipType is the schema descriptor for ownership_type field.
inboundorderDescOwnershipType := inboundorderFields[14].Descriptor()
inboundorderDescOwnershipType := inboundorderFields[15].Descriptor()
// inboundorder.DefaultOwnershipType holds the default value on creation for the ownership_type field.
inboundorder.DefaultOwnershipType = inboundorderDescOwnershipType.Default.(string)
// inboundorderDescVoided is the schema descriptor for voided field.
inboundorderDescVoided := inboundorderFields[18].Descriptor()
inboundorderDescVoided := inboundorderFields[19].Descriptor()
// inboundorder.DefaultVoided holds the default value on creation for the voided field.
inboundorder.DefaultVoided = inboundorderDescVoided.Default.(bool)
// inboundorderDescCreatedAt is the schema descriptor for created_at field.
inboundorderDescCreatedAt := inboundorderFields[22].Descriptor()
inboundorderDescCreatedAt := inboundorderFields[23].Descriptor()
// inboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
inboundorder.DefaultCreatedAt = inboundorderDescCreatedAt.Default.(func() int64)
inspectionrecordFields := schema.InspectionRecord{}.Fields()
@@ -219,50 +223,54 @@ func init() {
inspectionrecord.DefaultUpdatedAt = inspectionrecordDescUpdatedAt.Default.(func() int64)
inventoryFields := schema.Inventory{}.Fields()
_ = inventoryFields
// inventoryDescSnMode is the schema descriptor for sn_mode field.
inventoryDescSnMode := inventoryFields[1].Descriptor()
// inventory.DefaultSnMode holds the default value on creation for the sn_mode field.
inventory.DefaultSnMode = inventoryDescSnMode.Default.(int)
// inventoryDescCategory is the schema descriptor for category field.
inventoryDescCategory := inventoryFields[1].Descriptor()
inventoryDescCategory := inventoryFields[2].Descriptor()
// inventory.DefaultCategory holds the default value on creation for the category field.
inventory.DefaultCategory = inventoryDescCategory.Default.(int)
// inventoryDescQuantity is the schema descriptor for quantity field.
inventoryDescQuantity := inventoryFields[6].Descriptor()
inventoryDescQuantity := inventoryFields[7].Descriptor()
// inventory.DefaultQuantity holds the default value on creation for the quantity field.
inventory.DefaultQuantity = inventoryDescQuantity.Default.(int)
// inventoryDescLockedQty is the schema descriptor for locked_qty field.
inventoryDescLockedQty := inventoryFields[7].Descriptor()
inventoryDescLockedQty := inventoryFields[8].Descriptor()
// inventory.DefaultLockedQty holds the default value on creation for the locked_qty field.
inventory.DefaultLockedQty = inventoryDescLockedQty.Default.(int)
// inventoryDescQualityStatus is the schema descriptor for quality_status field.
inventoryDescQualityStatus := inventoryFields[8].Descriptor()
inventoryDescQualityStatus := inventoryFields[9].Descriptor()
// inventory.DefaultQualityStatus holds the default value on creation for the quality_status field.
inventory.DefaultQualityStatus = inventoryDescQualityStatus.Default.(string)
// inventoryDescStatus is the schema descriptor for status field.
inventoryDescStatus := inventoryFields[13].Descriptor()
inventoryDescStatus := inventoryFields[14].Descriptor()
// inventory.DefaultStatus holds the default value on creation for the status field.
inventory.DefaultStatus = inventoryDescStatus.Default.(string)
// inventoryDescOrderNo is the schema descriptor for order_no field.
inventoryDescOrderNo := inventoryFields[17].Descriptor()
inventoryDescOrderNo := inventoryFields[18].Descriptor()
// inventory.DefaultOrderNo holds the default value on creation for the order_no field.
inventory.DefaultOrderNo = inventoryDescOrderNo.Default.(string)
// inventory.OrderNoValidator is a validator for the "order_no" field. It is called by the builders before save.
inventory.OrderNoValidator = inventoryDescOrderNo.Validators[0].(func(string) error)
// inventoryDescCompletedProcess is the schema descriptor for completed_process field.
inventoryDescCompletedProcess := inventoryFields[19].Descriptor()
inventoryDescCompletedProcess := inventoryFields[20].Descriptor()
// inventory.DefaultCompletedProcess holds the default value on creation for the completed_process field.
inventory.DefaultCompletedProcess = inventoryDescCompletedProcess.Default.(string)
// inventory.CompletedProcessValidator is a validator for the "completed_process" field. It is called by the builders before save.
inventory.CompletedProcessValidator = inventoryDescCompletedProcess.Validators[0].(func(string) error)
// inventoryDescStocktakeNo is the schema descriptor for stocktake_no field.
inventoryDescStocktakeNo := inventoryFields[28].Descriptor()
inventoryDescStocktakeNo := inventoryFields[29].Descriptor()
// inventory.DefaultStocktakeNo holds the default value on creation for the stocktake_no field.
inventory.DefaultStocktakeNo = inventoryDescStocktakeNo.Default.(string)
// inventory.StocktakeNoValidator is a validator for the "stocktake_no" field. It is called by the builders before save.
inventory.StocktakeNoValidator = inventoryDescStocktakeNo.Validators[0].(func(string) error)
// inventoryDescCreatedAt is the schema descriptor for created_at field.
inventoryDescCreatedAt := inventoryFields[30].Descriptor()
inventoryDescCreatedAt := inventoryFields[31].Descriptor()
// inventory.DefaultCreatedAt holds the default value on creation for the created_at field.
inventory.DefaultCreatedAt = inventoryDescCreatedAt.Default.(func() int64)
// inventoryDescUpdatedAt is the schema descriptor for updated_at field.
inventoryDescUpdatedAt := inventoryFields[31].Descriptor()
inventoryDescUpdatedAt := inventoryFields[32].Descriptor()
// inventory.DefaultUpdatedAt holds the default value on creation for the updated_at field.
inventory.DefaultUpdatedAt = inventoryDescUpdatedAt.Default.(func() int64)
inventorylockFields := schema.InventoryLock{}.Fields()
@@ -293,28 +301,32 @@ func init() {
materialDescManageMode := materialFields[6].Descriptor()
// material.DefaultManageMode holds the default value on creation for the manage_mode field.
material.DefaultManageMode = materialDescManageMode.Default.(int)
// materialDescSnMode is the schema descriptor for sn_mode field.
materialDescSnMode := materialFields[7].Descriptor()
// material.DefaultSnMode holds the default value on creation for the sn_mode field.
material.DefaultSnMode = materialDescSnMode.Default.(int)
// materialDescIsBatchManaged is the schema descriptor for is_batch_managed field.
materialDescIsBatchManaged := materialFields[7].Descriptor()
materialDescIsBatchManaged := materialFields[8].Descriptor()
// material.DefaultIsBatchManaged holds the default value on creation for the is_batch_managed field.
material.DefaultIsBatchManaged = materialDescIsBatchManaged.Default.(bool)
// materialDescIsSerialManaged is the schema descriptor for is_serial_managed field.
materialDescIsSerialManaged := materialFields[8].Descriptor()
materialDescIsSerialManaged := materialFields[9].Descriptor()
// material.DefaultIsSerialManaged holds the default value on creation for the is_serial_managed field.
material.DefaultIsSerialManaged = materialDescIsSerialManaged.Default.(bool)
// materialDescSafetyStock is the schema descriptor for safety_stock field.
materialDescSafetyStock := materialFields[10].Descriptor()
materialDescSafetyStock := materialFields[11].Descriptor()
// material.DefaultSafetyStock holds the default value on creation for the safety_stock field.
material.DefaultSafetyStock = materialDescSafetyStock.Default.(int)
// materialDescIsActive is the schema descriptor for is_active field.
materialDescIsActive := materialFields[11].Descriptor()
materialDescIsActive := materialFields[12].Descriptor()
// material.DefaultIsActive holds the default value on creation for the is_active field.
material.DefaultIsActive = materialDescIsActive.Default.(bool)
// materialDescCreatedAt is the schema descriptor for created_at field.
materialDescCreatedAt := materialFields[12].Descriptor()
materialDescCreatedAt := materialFields[13].Descriptor()
// material.DefaultCreatedAt holds the default value on creation for the created_at field.
material.DefaultCreatedAt = materialDescCreatedAt.Default.(func() int64)
// materialDescUpdatedAt is the schema descriptor for updated_at field.
materialDescUpdatedAt := materialFields[13].Descriptor()
materialDescUpdatedAt := materialFields[14].Descriptor()
// material.DefaultUpdatedAt holds the default value on creation for the updated_at field.
material.DefaultUpdatedAt = materialDescUpdatedAt.Default.(func() int64)
materialdemandFields := schema.MaterialDemand{}.Fields()
@@ -385,12 +397,16 @@ func init() {
outboundorderDescManageMode := outboundorderFields[11].Descriptor()
// outboundorder.DefaultManageMode holds the default value on creation for the manage_mode field.
outboundorder.DefaultManageMode = outboundorderDescManageMode.Default.(int)
// outboundorderDescSnMode is the schema descriptor for sn_mode field.
outboundorderDescSnMode := outboundorderFields[12].Descriptor()
// outboundorder.DefaultSnMode holds the default value on creation for the sn_mode field.
outboundorder.DefaultSnMode = outboundorderDescSnMode.Default.(int)
// outboundorderDescQuantity is the schema descriptor for quantity field.
outboundorderDescQuantity := outboundorderFields[17].Descriptor()
outboundorderDescQuantity := outboundorderFields[18].Descriptor()
// outboundorder.DefaultQuantity holds the default value on creation for the quantity field.
outboundorder.DefaultQuantity = outboundorderDescQuantity.Default.(int)
// outboundorderDescCreatedAt is the schema descriptor for created_at field.
outboundorderDescCreatedAt := outboundorderFields[27].Descriptor()
outboundorderDescCreatedAt := outboundorderFields[28].Descriptor()
// outboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
outboundorder.DefaultCreatedAt = outboundorderDescCreatedAt.Default.(func() int64)
permissionFields := schema.Permission{}.Fields()