feat: 重构BOM架构,新增基础设置与虚拟工位管理功能

本次重构删除原有BOM物料清单表,改用工单工艺组合×工艺物料清单作为唯一用料来源;新增系统基础设置表支持WMS地址、日志保留天数等配置,新增虚拟工位作业管理后台接口与前端页签控制功能,同时优化工位号校验逻辑、事件日志自动清理与工单用料查询能力。
This commit is contained in:
SunYF
2026-09-23 11:41:28 +08:00
parent d3eda6b588
commit f274da044c
74 changed files with 3637 additions and 5586 deletions
+16 -70
View File
@@ -7,7 +7,6 @@ import (
"bj_power_mes/ent/alertrule"
"bj_power_mes/ent/associationtrace"
"bj_power_mes/ent/attachment"
"bj_power_mes/ent/bomitem"
"bj_power_mes/ent/dailyplan"
"bj_power_mes/ent/dock"
"bj_power_mes/ent/eventlog"
@@ -27,6 +26,7 @@ import (
"bj_power_mes/ent/stationstate"
"bj_power_mes/ent/stepcriterion"
"bj_power_mes/ent/stepdata"
"bj_power_mes/ent/sysconfig"
"bj_power_mes/ent/torqueauditlog"
"bj_power_mes/ent/torquerecord"
"bj_power_mes/ent/user"
@@ -253,74 +253,6 @@ func init() {
attachmentDescID := attachmentFields[0].Descriptor()
// attachment.IDValidator is a validator for the "id" field. It is called by the builders before save.
attachment.IDValidator = attachmentDescID.Validators[0].(func(int) error)
bomitemFields := schema.BomItem{}.Fields()
_ = bomitemFields
// bomitemDescProductCode is the schema descriptor for productCode field.
bomitemDescProductCode := bomitemFields[1].Descriptor()
// bomitem.DefaultProductCode holds the default value on creation for the productCode field.
bomitem.DefaultProductCode = bomitemDescProductCode.Default.(string)
// bomitem.ProductCodeValidator is a validator for the "productCode" field. It is called by the builders before save.
bomitem.ProductCodeValidator = bomitemDescProductCode.Validators[0].(func(string) error)
// bomitemDescBomName is the schema descriptor for bomName field.
bomitemDescBomName := bomitemFields[2].Descriptor()
// bomitem.DefaultBomName holds the default value on creation for the bomName field.
bomitem.DefaultBomName = bomitemDescBomName.Default.(string)
// bomitem.BomNameValidator is a validator for the "bomName" field. It is called by the builders before save.
bomitem.BomNameValidator = bomitemDescBomName.Validators[0].(func(string) error)
// bomitemDescMaterialCode is the schema descriptor for materialCode field.
bomitemDescMaterialCode := bomitemFields[3].Descriptor()
// bomitem.MaterialCodeValidator is a validator for the "materialCode" field. It is called by the builders before save.
bomitem.MaterialCodeValidator = bomitemDescMaterialCode.Validators[0].(func(string) error)
// bomitemDescMaterialName is the schema descriptor for materialName field.
bomitemDescMaterialName := bomitemFields[4].Descriptor()
// bomitem.DefaultMaterialName holds the default value on creation for the materialName field.
bomitem.DefaultMaterialName = bomitemDescMaterialName.Default.(string)
// bomitem.MaterialNameValidator is a validator for the "materialName" field. It is called by the builders before save.
bomitem.MaterialNameValidator = bomitemDescMaterialName.Validators[0].(func(string) error)
// bomitemDescSpec is the schema descriptor for spec field.
bomitemDescSpec := bomitemFields[5].Descriptor()
// bomitem.DefaultSpec holds the default value on creation for the spec field.
bomitem.DefaultSpec = bomitemDescSpec.Default.(string)
// bomitem.SpecValidator is a validator for the "spec" field. It is called by the builders before save.
bomitem.SpecValidator = bomitemDescSpec.Validators[0].(func(string) error)
// bomitemDescUnit is the schema descriptor for unit field.
bomitemDescUnit := bomitemFields[6].Descriptor()
// bomitem.DefaultUnit holds the default value on creation for the unit field.
bomitem.DefaultUnit = bomitemDescUnit.Default.(string)
// bomitem.UnitValidator is a validator for the "unit" field. It is called by the builders before save.
bomitem.UnitValidator = bomitemDescUnit.Validators[0].(func(string) error)
// bomitemDescManageMode is the schema descriptor for manageMode field.
bomitemDescManageMode := bomitemFields[7].Descriptor()
// bomitem.DefaultManageMode holds the default value on creation for the manageMode field.
bomitem.DefaultManageMode = bomitemDescManageMode.Default.(string)
// bomitem.ManageModeValidator is a validator for the "manageMode" field. It is called by the builders before save.
bomitem.ManageModeValidator = bomitemDescManageMode.Validators[0].(func(string) error)
// bomitemDescUnitQty is the schema descriptor for unitQty field.
bomitemDescUnitQty := bomitemFields[8].Descriptor()
// bomitem.DefaultUnitQty holds the default value on creation for the unitQty field.
bomitem.DefaultUnitQty = bomitemDescUnitQty.Default.(float64)
// bomitemDescLossRate is the schema descriptor for lossRate field.
bomitemDescLossRate := bomitemFields[9].Descriptor()
// bomitem.DefaultLossRate holds the default value on creation for the lossRate field.
bomitem.DefaultLossRate = bomitemDescLossRate.Default.(float64)
// bomitemDescRelatedStandard is the schema descriptor for relatedStandard field.
bomitemDescRelatedStandard := bomitemFields[10].Descriptor()
// bomitem.DefaultRelatedStandard holds the default value on creation for the relatedStandard field.
bomitem.DefaultRelatedStandard = bomitemDescRelatedStandard.Default.(string)
// bomitem.RelatedStandardValidator is a validator for the "relatedStandard" field. It is called by the builders before save.
bomitem.RelatedStandardValidator = bomitemDescRelatedStandard.Validators[0].(func(string) error)
// bomitemDescRequiredQty is the schema descriptor for requiredQty field.
bomitemDescRequiredQty := bomitemFields[11].Descriptor()
// bomitem.DefaultRequiredQty holds the default value on creation for the requiredQty field.
bomitem.DefaultRequiredQty = bomitemDescRequiredQty.Default.(float64)
// bomitemDescCreatedAt is the schema descriptor for createdAt field.
bomitemDescCreatedAt := bomitemFields[13].Descriptor()
// bomitem.DefaultCreatedAt holds the default value on creation for the createdAt field.
bomitem.DefaultCreatedAt = bomitemDescCreatedAt.Default.(func() time.Time)
// bomitemDescID is the schema descriptor for id field.
bomitemDescID := bomitemFields[0].Descriptor()
// bomitem.IDValidator is a validator for the "id" field. It is called by the builders before save.
bomitem.IDValidator = bomitemDescID.Validators[0].(func(int) error)
dailyplanFields := schema.DailyPlan{}.Fields()
_ = dailyplanFields
// dailyplanDescOrderNo is the schema descriptor for orderNo field.
@@ -1238,7 +1170,7 @@ func init() {
// station.DockCodeValidator is a validator for the "dockCode" field. It is called by the builders before save.
station.DockCodeValidator = stationDescDockCode.Validators[0].(func(string) error)
// stationDescCreatedAt is the schema descriptor for createdAt field.
stationDescCreatedAt := stationFields[9].Descriptor()
stationDescCreatedAt := stationFields[10].Descriptor()
// station.DefaultCreatedAt holds the default value on creation for the createdAt field.
station.DefaultCreatedAt = stationDescCreatedAt.Default.(func() time.Time)
// stationDescID is the schema descriptor for id field.
@@ -1363,6 +1295,20 @@ func init() {
stepdataDescID := stepdataFields[0].Descriptor()
// stepdata.IDValidator is a validator for the "id" field. It is called by the builders before save.
stepdata.IDValidator = stepdataDescID.Validators[0].(func(int) error)
sysconfigFields := schema.SysConfig{}.Fields()
_ = sysconfigFields
// sysconfigDescKey is the schema descriptor for key field.
sysconfigDescKey := sysconfigFields[0].Descriptor()
// sysconfig.KeyValidator is a validator for the "key" field. It is called by the builders before save.
sysconfig.KeyValidator = sysconfigDescKey.Validators[0].(func(string) error)
// sysconfigDescValue is the schema descriptor for value field.
sysconfigDescValue := sysconfigFields[1].Descriptor()
// sysconfig.ValueValidator is a validator for the "value" field. It is called by the builders before save.
sysconfig.ValueValidator = sysconfigDescValue.Validators[0].(func(string) error)
// sysconfigDescRemark is the schema descriptor for remark field.
sysconfigDescRemark := sysconfigFields[2].Descriptor()
// sysconfig.RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
sysconfig.RemarkValidator = sysconfigDescRemark.Validators[0].(func(string) error)
torqueauditlogFields := schema.TorqueAuditLog{}.Fields()
_ = torqueauditlogFields
// torqueauditlogDescAction is the schema descriptor for action field.