refactor: 重构工艺工序相关命名与数据模型

1.  全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2.  重构工单与工件工艺数据模型:
    - 新增工艺组合表flow_material作为备料/齐套唯一源头
    - 新增工位状态表station_state支持自主停单/恢复接单
    - 移除station_process派工表,改用工单工艺组合作为路线唯一源头
    - 替换processCode为flowId作为工艺关联标识
    - 重构工件当前进度字段为currentStationNo
3.  删除冗余的静态备份资源文件
4.  调整物料选择组件默认启用仅显示激活物料
5.  优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
SunYF
2026-09-22 11:32:29 +08:00
parent 932700ca65
commit d609ff8a9e
185 changed files with 8623 additions and 4501 deletions
+96 -45
View File
@@ -11,6 +11,7 @@ import (
"bj_power_mes/ent/dailyplan"
"bj_power_mes/ent/dock"
"bj_power_mes/ent/eventlog"
"bj_power_mes/ent/flowmaterial"
"bj_power_mes/ent/inspectionrecord"
"bj_power_mes/ent/linepoint"
"bj_power_mes/ent/materialqtyreport"
@@ -23,7 +24,7 @@ import (
"bj_power_mes/ent/role"
"bj_power_mes/ent/semiflow"
"bj_power_mes/ent/station"
"bj_power_mes/ent/stationprocess"
"bj_power_mes/ent/stationstate"
"bj_power_mes/ent/stepcriterion"
"bj_power_mes/ent/stepdata"
"bj_power_mes/ent/torqueauditlog"
@@ -294,30 +295,26 @@ func init() {
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)
// bomitemDescProcessCode is the schema descriptor for processCode field.
bomitemDescProcessCode := bomitemFields[8].Descriptor()
// bomitem.DefaultProcessCode holds the default value on creation for the processCode field.
bomitem.DefaultProcessCode = bomitemDescProcessCode.Default.(int)
// bomitemDescUnitQty is the schema descriptor for unitQty field.
bomitemDescUnitQty := bomitemFields[9].Descriptor()
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[10].Descriptor()
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[11].Descriptor()
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[12].Descriptor()
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[14].Descriptor()
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.
@@ -452,6 +449,52 @@ func init() {
eventlogDescID := eventlogFields[0].Descriptor()
// eventlog.IDValidator is a validator for the "id" field. It is called by the builders before save.
eventlog.IDValidator = eventlogDescID.Validators[0].(func(int) error)
flowmaterialFields := schema.FlowMaterial{}.Fields()
_ = flowmaterialFields
// flowmaterialDescMaterialCode is the schema descriptor for materialCode field.
flowmaterialDescMaterialCode := flowmaterialFields[2].Descriptor()
// flowmaterial.MaterialCodeValidator is a validator for the "materialCode" field. It is called by the builders before save.
flowmaterial.MaterialCodeValidator = flowmaterialDescMaterialCode.Validators[0].(func(string) error)
// flowmaterialDescMaterialName is the schema descriptor for materialName field.
flowmaterialDescMaterialName := flowmaterialFields[3].Descriptor()
// flowmaterial.DefaultMaterialName holds the default value on creation for the materialName field.
flowmaterial.DefaultMaterialName = flowmaterialDescMaterialName.Default.(string)
// flowmaterial.MaterialNameValidator is a validator for the "materialName" field. It is called by the builders before save.
flowmaterial.MaterialNameValidator = flowmaterialDescMaterialName.Validators[0].(func(string) error)
// flowmaterialDescSpec is the schema descriptor for spec field.
flowmaterialDescSpec := flowmaterialFields[4].Descriptor()
// flowmaterial.DefaultSpec holds the default value on creation for the spec field.
flowmaterial.DefaultSpec = flowmaterialDescSpec.Default.(string)
// flowmaterial.SpecValidator is a validator for the "spec" field. It is called by the builders before save.
flowmaterial.SpecValidator = flowmaterialDescSpec.Validators[0].(func(string) error)
// flowmaterialDescUnit is the schema descriptor for unit field.
flowmaterialDescUnit := flowmaterialFields[5].Descriptor()
// flowmaterial.DefaultUnit holds the default value on creation for the unit field.
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)
// flowmaterialDescUnitQty is the schema descriptor for unitQty field.
flowmaterialDescUnitQty := flowmaterialFields[7].Descriptor()
// flowmaterial.DefaultUnitQty holds the default value on creation for the unitQty field.
flowmaterial.DefaultUnitQty = flowmaterialDescUnitQty.Default.(float64)
// flowmaterialDescLossRate is the schema descriptor for lossRate field.
flowmaterialDescLossRate := flowmaterialFields[8].Descriptor()
// flowmaterial.DefaultLossRate holds the default value on creation for the lossRate field.
flowmaterial.DefaultLossRate = flowmaterialDescLossRate.Default.(float64)
// flowmaterialDescCreatedAt is the schema descriptor for createdAt field.
flowmaterialDescCreatedAt := flowmaterialFields[9].Descriptor()
// flowmaterial.DefaultCreatedAt holds the default value on creation for the createdAt field.
flowmaterial.DefaultCreatedAt = flowmaterialDescCreatedAt.Default.(func() time.Time)
// flowmaterialDescID is the schema descriptor for id field.
flowmaterialDescID := flowmaterialFields[0].Descriptor()
// flowmaterial.IDValidator is a validator for the "id" field. It is called by the builders before save.
flowmaterial.IDValidator = flowmaterialDescID.Validators[0].(func(int) error)
inspectionrecordFields := schema.InspectionRecord{}.Fields()
_ = inspectionrecordFields
// inspectionrecordDescCategory is the schema descriptor for category field.
@@ -784,10 +827,10 @@ func init() {
materialrequestDescStationNo := materialrequestFields[11].Descriptor()
// materialrequest.DefaultStationNo holds the default value on creation for the stationNo field.
materialrequest.DefaultStationNo = materialrequestDescStationNo.Default.(int)
// materialrequestDescProcessCode is the schema descriptor for processCode field.
materialrequestDescProcessCode := materialrequestFields[12].Descriptor()
// materialrequest.DefaultProcessCode holds the default value on creation for the processCode field.
materialrequest.DefaultProcessCode = materialrequestDescProcessCode.Default.(int)
// materialrequestDescFlowId is the schema descriptor for flowId field.
materialrequestDescFlowId := materialrequestFields[12].Descriptor()
// materialrequest.DefaultFlowId holds the default value on creation for the flowId field.
materialrequest.DefaultFlowId = materialrequestDescFlowId.Default.(int)
// materialrequestDescSentQty is the schema descriptor for sentQty field.
materialrequestDescSentQty := materialrequestFields[13].Descriptor()
// materialrequest.DefaultSentQty holds the default value on creation for the sentQty field.
@@ -1196,34 +1239,42 @@ func init() {
stationDescID := stationFields[0].Descriptor()
// station.IDValidator is a validator for the "id" field. It is called by the builders before save.
station.IDValidator = stationDescID.Validators[0].(func(int) error)
stationprocessFields := schema.StationProcess{}.Fields()
_ = stationprocessFields
// stationprocessDescEffectDate is the schema descriptor for effectDate field.
stationprocessDescEffectDate := stationprocessFields[3].Descriptor()
// stationprocess.DefaultEffectDate holds the default value on creation for the effectDate field.
stationprocess.DefaultEffectDate = stationprocessDescEffectDate.Default.(string)
// stationprocess.EffectDateValidator is a validator for the "effectDate" field. It is called by the builders before save.
stationprocess.EffectDateValidator = stationprocessDescEffectDate.Validators[0].(func(string) error)
// stationprocessDescShift is the schema descriptor for shift field.
stationprocessDescShift := stationprocessFields[4].Descriptor()
// stationprocess.DefaultShift holds the default value on creation for the shift field.
stationprocess.DefaultShift = stationprocessDescShift.Default.(string)
// stationprocess.ShiftValidator is a validator for the "shift" field. It is called by the builders before save.
stationprocess.ShiftValidator = stationprocessDescShift.Validators[0].(func(string) error)
// stationprocessDescOperator is the schema descriptor for operator field.
stationprocessDescOperator := stationprocessFields[5].Descriptor()
// stationprocess.DefaultOperator holds the default value on creation for the operator field.
stationprocess.DefaultOperator = stationprocessDescOperator.Default.(string)
// stationprocess.OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
stationprocess.OperatorValidator = stationprocessDescOperator.Validators[0].(func(string) error)
// stationprocessDescCreatedAt is the schema descriptor for createdAt field.
stationprocessDescCreatedAt := stationprocessFields[6].Descriptor()
// stationprocess.DefaultCreatedAt holds the default value on creation for the createdAt field.
stationprocess.DefaultCreatedAt = stationprocessDescCreatedAt.Default.(func() time.Time)
// stationprocessDescID is the schema descriptor for id field.
stationprocessDescID := stationprocessFields[0].Descriptor()
// stationprocess.IDValidator is a validator for the "id" field. It is called by the builders before save.
stationprocess.IDValidator = stationprocessDescID.Validators[0].(func(int) error)
stationstateFields := schema.StationState{}.Fields()
_ = stationstateFields
// stationstateDescDate is the schema descriptor for date field.
stationstateDescDate := stationstateFields[2].Descriptor()
// stationstate.DateValidator is a validator for the "date" field. It is called by the builders before save.
stationstate.DateValidator = stationstateDescDate.Validators[0].(func(string) error)
// stationstateDescPaused is the schema descriptor for paused field.
stationstateDescPaused := stationstateFields[3].Descriptor()
// stationstate.DefaultPaused holds the default value on creation for the paused field.
stationstate.DefaultPaused = stationstateDescPaused.Default.(bool)
// stationstateDescReason is the schema descriptor for reason field.
stationstateDescReason := stationstateFields[4].Descriptor()
// stationstate.DefaultReason holds the default value on creation for the reason field.
stationstate.DefaultReason = stationstateDescReason.Default.(string)
// stationstate.ReasonValidator is a validator for the "reason" field. It is called by the builders before save.
stationstate.ReasonValidator = stationstateDescReason.Validators[0].(func(string) error)
// stationstateDescOperator is the schema descriptor for operator field.
stationstateDescOperator := stationstateFields[5].Descriptor()
// stationstate.DefaultOperator holds the default value on creation for the operator field.
stationstate.DefaultOperator = stationstateDescOperator.Default.(string)
// stationstate.OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
stationstate.OperatorValidator = stationstateDescOperator.Validators[0].(func(string) error)
// stationstateDescCreatedAt is the schema descriptor for createdAt field.
stationstateDescCreatedAt := stationstateFields[6].Descriptor()
// stationstate.DefaultCreatedAt holds the default value on creation for the createdAt field.
stationstate.DefaultCreatedAt = stationstateDescCreatedAt.Default.(func() time.Time)
// stationstateDescUpdatedAt is the schema descriptor for updatedAt field.
stationstateDescUpdatedAt := stationstateFields[7].Descriptor()
// stationstate.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
stationstate.DefaultUpdatedAt = stationstateDescUpdatedAt.Default.(func() time.Time)
// stationstate.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
stationstate.UpdateDefaultUpdatedAt = stationstateDescUpdatedAt.UpdateDefault.(func() time.Time)
// stationstateDescID is the schema descriptor for id field.
stationstateDescID := stationstateFields[0].Descriptor()
// stationstate.IDValidator is a validator for the "id" field. It is called by the builders before save.
stationstate.IDValidator = stationstateDescID.Validators[0].(func(int) error)
stepcriterionFields := schema.StepCriterion{}.Fields()
_ = stepcriterionFields
// stepcriterionDescName is the schema descriptor for name field.
@@ -1523,17 +1574,17 @@ func init() {
// 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[13].Descriptor()
workorderDescStatus := workorderFields[14].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[18].Descriptor()
workorderDescCreatedAt := workorderFields[19].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[19].Descriptor()
workorderDescUpdatedAt := workorderFields[20].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.