refactor: 重构工艺工序相关命名与数据模型
1. 全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2. 重构工单与工件工艺数据模型:
- 新增工艺组合表flow_material作为备料/齐套唯一源头
- 新增工位状态表station_state支持自主停单/恢复接单
- 移除station_process派工表,改用工单工艺组合作为路线唯一源头
- 替换processCode为flowId作为工艺关联标识
- 重构工件当前进度字段为currentStationNo
3. 删除冗余的静态备份资源文件
4. 调整物料选择组件默认启用仅显示激活物料
5. 优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/dialect/sql/sqljson"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
@@ -231,6 +232,24 @@ func (_u *WorkOrderUpdate) ClearDueDate() *WorkOrderUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFlowCombination sets the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdate) SetFlowCombination(v []map[string]int) *WorkOrderUpdate {
|
||||
_u.mutation.SetFlowCombination(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// AppendFlowCombination appends value to the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdate) AppendFlowCombination(v []map[string]int) *WorkOrderUpdate {
|
||||
_u.mutation.AppendFlowCombination(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFlowCombination clears the value of the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdate) ClearFlowCombination() *WorkOrderUpdate {
|
||||
_u.mutation.ClearFlowCombination()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (_u *WorkOrderUpdate) SetStatus(v string) *WorkOrderUpdate {
|
||||
_u.mutation.SetStatus(v)
|
||||
@@ -484,6 +503,17 @@ func (_u *WorkOrderUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.DueDateCleared() {
|
||||
_spec.ClearField(workorder.FieldDueDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.FlowCombination(); ok {
|
||||
_spec.SetField(workorder.FieldFlowCombination, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AppendedFlowCombination(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, workorder.FieldFlowCombination, value)
|
||||
})
|
||||
}
|
||||
if _u.mutation.FlowCombinationCleared() {
|
||||
_spec.ClearField(workorder.FieldFlowCombination, field.TypeJSON)
|
||||
}
|
||||
if value, ok := _u.mutation.Status(); ok {
|
||||
_spec.SetField(workorder.FieldStatus, field.TypeString, value)
|
||||
}
|
||||
@@ -741,6 +771,24 @@ func (_u *WorkOrderUpdateOne) ClearDueDate() *WorkOrderUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetFlowCombination sets the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdateOne) SetFlowCombination(v []map[string]int) *WorkOrderUpdateOne {
|
||||
_u.mutation.SetFlowCombination(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// AppendFlowCombination appends value to the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdateOne) AppendFlowCombination(v []map[string]int) *WorkOrderUpdateOne {
|
||||
_u.mutation.AppendFlowCombination(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearFlowCombination clears the value of the "flowCombination" field.
|
||||
func (_u *WorkOrderUpdateOne) ClearFlowCombination() *WorkOrderUpdateOne {
|
||||
_u.mutation.ClearFlowCombination()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (_u *WorkOrderUpdateOne) SetStatus(v string) *WorkOrderUpdateOne {
|
||||
_u.mutation.SetStatus(v)
|
||||
@@ -1024,6 +1072,17 @@ func (_u *WorkOrderUpdateOne) sqlSave(ctx context.Context) (_node *WorkOrder, er
|
||||
if _u.mutation.DueDateCleared() {
|
||||
_spec.ClearField(workorder.FieldDueDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.FlowCombination(); ok {
|
||||
_spec.SetField(workorder.FieldFlowCombination, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AppendedFlowCombination(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, workorder.FieldFlowCombination, value)
|
||||
})
|
||||
}
|
||||
if _u.mutation.FlowCombinationCleared() {
|
||||
_spec.ClearField(workorder.FieldFlowCombination, field.TypeJSON)
|
||||
}
|
||||
if value, ok := _u.mutation.Status(); ok {
|
||||
_spec.SetField(workorder.FieldStatus, field.TypeString, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user