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:
+34
-30
@@ -406,12 +406,10 @@ func init() {
|
||||
flowmaterial.DefaultUnit = flowmaterialDescUnit.Default.(string)
|
||||
// flowmaterial.UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||||
flowmaterial.UnitValidator = flowmaterialDescUnit.Validators[0].(func(string) error)
|
||||
// flowmaterialDescManageMode is the schema descriptor for manageMode field.
|
||||
flowmaterialDescManageMode := flowmaterialFields[6].Descriptor()
|
||||
// flowmaterial.DefaultManageMode holds the default value on creation for the manageMode field.
|
||||
flowmaterial.DefaultManageMode = flowmaterialDescManageMode.Default.(string)
|
||||
// flowmaterial.ManageModeValidator is a validator for the "manageMode" field. It is called by the builders before save.
|
||||
flowmaterial.ManageModeValidator = flowmaterialDescManageMode.Validators[0].(func(string) error)
|
||||
// flowmaterialDescSnMode is the schema descriptor for snMode field.
|
||||
flowmaterialDescSnMode := flowmaterialFields[6].Descriptor()
|
||||
// flowmaterial.DefaultSnMode holds the default value on creation for the snMode field.
|
||||
flowmaterial.DefaultSnMode = flowmaterialDescSnMode.Default.(int)
|
||||
// flowmaterialDescUnitQty is the schema descriptor for unitQty field.
|
||||
flowmaterialDescUnitQty := flowmaterialFields[7].Descriptor()
|
||||
// flowmaterial.DefaultUnitQty holds the default value on creation for the unitQty field.
|
||||
@@ -648,30 +646,34 @@ func init() {
|
||||
materialDescManageMode := materialFields[6].Descriptor()
|
||||
// material.DefaultManageMode holds the default value on creation for the manageMode field.
|
||||
material.DefaultManageMode = materialDescManageMode.Default.(int)
|
||||
// materialDescSnMode is the schema descriptor for snMode field.
|
||||
materialDescSnMode := materialFields[7].Descriptor()
|
||||
// material.DefaultSnMode holds the default value on creation for the snMode field.
|
||||
material.DefaultSnMode = materialDescSnMode.Default.(int)
|
||||
// materialDescTemplateCode is the schema descriptor for templateCode field.
|
||||
materialDescTemplateCode := materialFields[7].Descriptor()
|
||||
materialDescTemplateCode := materialFields[8].Descriptor()
|
||||
// material.DefaultTemplateCode holds the default value on creation for the templateCode field.
|
||||
material.DefaultTemplateCode = materialDescTemplateCode.Default.(string)
|
||||
// material.TemplateCodeValidator is a validator for the "templateCode" field. It is called by the builders before save.
|
||||
material.TemplateCodeValidator = materialDescTemplateCode.Validators[0].(func(string) error)
|
||||
// materialDescSafetyStock is the schema descriptor for safetyStock field.
|
||||
materialDescSafetyStock := materialFields[8].Descriptor()
|
||||
materialDescSafetyStock := materialFields[9].Descriptor()
|
||||
// material.DefaultSafetyStock holds the default value on creation for the safetyStock field.
|
||||
material.DefaultSafetyStock = materialDescSafetyStock.Default.(int)
|
||||
// materialDescIsActive is the schema descriptor for isActive field.
|
||||
materialDescIsActive := materialFields[9].Descriptor()
|
||||
materialDescIsActive := materialFields[10].Descriptor()
|
||||
// material.DefaultIsActive holds the default value on creation for the isActive field.
|
||||
material.DefaultIsActive = materialDescIsActive.Default.(bool)
|
||||
// materialDescSyncPending is the schema descriptor for syncPending field.
|
||||
materialDescSyncPending := materialFields[10].Descriptor()
|
||||
materialDescSyncPending := materialFields[11].Descriptor()
|
||||
// material.DefaultSyncPending holds the default value on creation for the syncPending field.
|
||||
material.DefaultSyncPending = materialDescSyncPending.Default.(bool)
|
||||
// materialDescCreatedAt is the schema descriptor for createdAt field.
|
||||
materialDescCreatedAt := materialFields[11].Descriptor()
|
||||
materialDescCreatedAt := materialFields[12].Descriptor()
|
||||
// material.DefaultCreatedAt holds the default value on creation for the createdAt field.
|
||||
material.DefaultCreatedAt = materialDescCreatedAt.Default.(func() time.Time)
|
||||
// materialDescUpdatedAt is the schema descriptor for updatedAt field.
|
||||
materialDescUpdatedAt := materialFields[12].Descriptor()
|
||||
materialDescUpdatedAt := materialFields[13].Descriptor()
|
||||
// material.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
|
||||
material.DefaultUpdatedAt = materialDescUpdatedAt.Default.(func() time.Time)
|
||||
// material.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
|
||||
@@ -802,12 +804,10 @@ func init() {
|
||||
materialrequest.DefaultUnit = materialrequestDescUnit.Default.(string)
|
||||
// materialrequest.UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||||
materialrequest.UnitValidator = materialrequestDescUnit.Validators[0].(func(string) error)
|
||||
// materialrequestDescManageMode is the schema descriptor for manageMode field.
|
||||
materialrequestDescManageMode := materialrequestFields[7].Descriptor()
|
||||
// materialrequest.DefaultManageMode holds the default value on creation for the manageMode field.
|
||||
materialrequest.DefaultManageMode = materialrequestDescManageMode.Default.(string)
|
||||
// materialrequest.ManageModeValidator is a validator for the "manageMode" field. It is called by the builders before save.
|
||||
materialrequest.ManageModeValidator = materialrequestDescManageMode.Validators[0].(func(string) error)
|
||||
// materialrequestDescSnMode is the schema descriptor for snMode field.
|
||||
materialrequestDescSnMode := materialrequestFields[7].Descriptor()
|
||||
// materialrequest.DefaultSnMode holds the default value on creation for the snMode field.
|
||||
materialrequest.DefaultSnMode = materialrequestDescSnMode.Default.(int)
|
||||
// materialrequestDescReqQty is the schema descriptor for reqQty field.
|
||||
materialrequestDescReqQty := materialrequestFields[8].Descriptor()
|
||||
// materialrequest.DefaultReqQty holds the default value on creation for the reqQty field.
|
||||
@@ -1576,36 +1576,42 @@ func init() {
|
||||
workorder.DefaultContractNo = workorderDescContractNo.Default.(string)
|
||||
// workorder.ContractNoValidator is a validator for the "contractNo" field. It is called by the builders before save.
|
||||
workorder.ContractNoValidator = workorderDescContractNo.Validators[0].(func(string) error)
|
||||
// workorderDescOwnershipType is the schema descriptor for ownershipType field.
|
||||
workorderDescOwnershipType := workorderFields[9].Descriptor()
|
||||
// workorder.DefaultOwnershipType holds the default value on creation for the ownershipType field.
|
||||
workorder.DefaultOwnershipType = workorderDescOwnershipType.Default.(string)
|
||||
// workorder.OwnershipTypeValidator is a validator for the "ownershipType" field. It is called by the builders before save.
|
||||
workorder.OwnershipTypeValidator = workorderDescOwnershipType.Validators[0].(func(string) error)
|
||||
// workorderDescProjectNo is the schema descriptor for projectNo field.
|
||||
workorderDescProjectNo := workorderFields[9].Descriptor()
|
||||
workorderDescProjectNo := workorderFields[10].Descriptor()
|
||||
// workorder.DefaultProjectNo holds the default value on creation for the projectNo field.
|
||||
workorder.DefaultProjectNo = workorderDescProjectNo.Default.(string)
|
||||
// workorder.ProjectNoValidator is a validator for the "projectNo" field. It is called by the builders before save.
|
||||
workorder.ProjectNoValidator = workorderDescProjectNo.Validators[0].(func(string) error)
|
||||
// workorderDescProductSerial is the schema descriptor for productSerial field.
|
||||
workorderDescProductSerial := workorderFields[10].Descriptor()
|
||||
workorderDescProductSerial := workorderFields[11].Descriptor()
|
||||
// workorder.DefaultProductSerial holds the default value on creation for the productSerial field.
|
||||
workorder.DefaultProductSerial = workorderDescProductSerial.Default.(string)
|
||||
// workorder.ProductSerialValidator is a validator for the "productSerial" field. It is called by the builders before save.
|
||||
workorder.ProductSerialValidator = workorderDescProductSerial.Validators[0].(func(string) error)
|
||||
// workorderDescCreatedBy is the schema descriptor for createdBy field.
|
||||
workorderDescCreatedBy := workorderFields[11].Descriptor()
|
||||
workorderDescCreatedBy := workorderFields[12].Descriptor()
|
||||
// workorder.DefaultCreatedBy holds the default value on creation for the createdBy field.
|
||||
workorder.DefaultCreatedBy = workorderDescCreatedBy.Default.(string)
|
||||
// workorder.CreatedByValidator is a validator for the "createdBy" field. It is called by the builders before save.
|
||||
workorder.CreatedByValidator = workorderDescCreatedBy.Validators[0].(func(string) error)
|
||||
// workorderDescStatus is the schema descriptor for status field.
|
||||
workorderDescStatus := workorderFields[14].Descriptor()
|
||||
workorderDescStatus := workorderFields[15].Descriptor()
|
||||
// workorder.DefaultStatus holds the default value on creation for the status field.
|
||||
workorder.DefaultStatus = workorderDescStatus.Default.(string)
|
||||
// workorder.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
workorder.StatusValidator = workorderDescStatus.Validators[0].(func(string) error)
|
||||
// workorderDescCreatedAt is the schema descriptor for createdAt field.
|
||||
workorderDescCreatedAt := workorderFields[19].Descriptor()
|
||||
workorderDescCreatedAt := workorderFields[20].Descriptor()
|
||||
// workorder.DefaultCreatedAt holds the default value on creation for the createdAt field.
|
||||
workorder.DefaultCreatedAt = workorderDescCreatedAt.Default.(func() time.Time)
|
||||
// workorderDescUpdatedAt is the schema descriptor for updatedAt field.
|
||||
workorderDescUpdatedAt := workorderFields[20].Descriptor()
|
||||
workorderDescUpdatedAt := workorderFields[21].Descriptor()
|
||||
// workorder.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
|
||||
workorder.DefaultUpdatedAt = workorderDescUpdatedAt.Default.(func() time.Time)
|
||||
// workorder.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
|
||||
@@ -1686,12 +1692,10 @@ func init() {
|
||||
workpiecebind.DefaultUnit = workpiecebindDescUnit.Default.(string)
|
||||
// workpiecebind.UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||||
workpiecebind.UnitValidator = workpiecebindDescUnit.Validators[0].(func(string) error)
|
||||
// workpiecebindDescManageMode is the schema descriptor for manageMode field.
|
||||
workpiecebindDescManageMode := workpiecebindFields[9].Descriptor()
|
||||
// workpiecebind.DefaultManageMode holds the default value on creation for the manageMode field.
|
||||
workpiecebind.DefaultManageMode = workpiecebindDescManageMode.Default.(string)
|
||||
// workpiecebind.ManageModeValidator is a validator for the "manageMode" field. It is called by the builders before save.
|
||||
workpiecebind.ManageModeValidator = workpiecebindDescManageMode.Validators[0].(func(string) error)
|
||||
// workpiecebindDescSnMode is the schema descriptor for snMode field.
|
||||
workpiecebindDescSnMode := workpiecebindFields[9].Descriptor()
|
||||
// workpiecebind.DefaultSnMode holds the default value on creation for the snMode field.
|
||||
workpiecebind.DefaultSnMode = workpiecebindDescSnMode.Default.(int)
|
||||
// workpiecebindDescBindValue is the schema descriptor for bindValue field.
|
||||
workpiecebindDescBindValue := workpiecebindFields[10].Descriptor()
|
||||
// workpiecebind.BindValueValidator is a validator for the "bindValue" field. It is called by the builders before save.
|
||||
|
||||
Reference in New Issue
Block a user