refactor: 重构工艺工序相关命名与数据模型
1. 全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2. 重构工单与工件工艺数据模型:
- 新增工艺组合表flow_material作为备料/齐套唯一源头
- 新增工位状态表station_state支持自主停单/恢复接单
- 移除station_process派工表,改用工单工艺组合作为路线唯一源头
- 替换processCode为flowId作为工艺关联标识
- 重构工件当前进度字段为currentStationNo
3. 删除冗余的静态备份资源文件
4. 调整物料选择组件默认启用仅显示激活物料
5. 优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
@@ -42,6 +42,8 @@ type WorkOrder struct {
|
||||
CreatedBy string `json:"createdBy,omitempty"`
|
||||
// 完成日期(必填)
|
||||
DueDate *time.Time `json:"dueDate,omitempty"`
|
||||
// 工艺组合 [{flowId,stationNo}] 按工位号升序
|
||||
FlowCombination []map[string]int `json:"flowCombination,omitempty"`
|
||||
// Status holds the value of the "status" field.
|
||||
Status string `json:"status,omitempty"`
|
||||
// 计划开始
|
||||
@@ -64,7 +66,7 @@ func (*WorkOrder) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case workorder.FieldContext:
|
||||
case workorder.FieldFlowCombination, workorder.FieldContext:
|
||||
values[i] = new([]byte)
|
||||
case workorder.FieldID, workorder.FieldProductTypeId, workorder.FieldQuantity, workorder.FieldFinishedNum, workorder.FieldFailNum:
|
||||
values[i] = new(sql.NullInt64)
|
||||
@@ -166,6 +168,14 @@ func (_m *WorkOrder) assignValues(columns []string, values []any) error {
|
||||
_m.DueDate = new(time.Time)
|
||||
*_m.DueDate = value.Time
|
||||
}
|
||||
case workorder.FieldFlowCombination:
|
||||
if value, ok := values[i].(*[]byte); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field flowCombination", values[i])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &_m.FlowCombination); err != nil {
|
||||
return fmt.Errorf("unmarshal field flowCombination: %w", err)
|
||||
}
|
||||
}
|
||||
case workorder.FieldStatus:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field status", values[i])
|
||||
@@ -288,6 +298,9 @@ func (_m *WorkOrder) String() string {
|
||||
builder.WriteString(v.Format(time.ANSIC))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("flowCombination=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.FlowCombination))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("status=")
|
||||
builder.WriteString(_m.Status)
|
||||
builder.WriteString(", ")
|
||||
|
||||
Reference in New Issue
Block a user