refactor(mes): 移除工位接驳台绑定逻辑,改为独立dock主数据

- 移除station表的hasDock、dockCode字段及相关代码
- 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台
- 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式
- 新增SQL注释固化脚本,完善MES表注释
This commit is contained in:
SunYF
2026-10-08 13:09:53 +08:00
parent 7c7c16ee6d
commit 1f7a42fc38
132 changed files with 2799 additions and 1090 deletions
+3 -25
View File
@@ -13,7 +13,7 @@ import (
"entgo.io/ent/dialect/sql"
)
// Station is the model entity for the Station schema.
// Station 工位主数据:工位固定只对应一个工序编号,绑定一个工艺流程图(flowId)
type Station struct {
config `json:"-"`
// ID of the ent.
@@ -30,10 +30,6 @@ type Station struct {
Status string `json:"status,omitempty"`
// 内置工位:不可改类型/不可删除
IsBuiltin bool `json:"isBuiltin,omitempty"`
// 是否有接驳台(实体位置,内置不可改)
HasDock bool `json:"hasDock,omitempty"`
// 接驳台编码 DOCK01..21
DockCode string `json:"dockCode,omitempty"`
// VisibleTabs holds the value of the "visibleTabs" field.
VisibleTabs []string `json:"visibleTabs,omitempty"`
// CreatedAt holds the value of the "createdAt" field.
@@ -48,11 +44,11 @@ func (*Station) scanValues(columns []string) ([]any, error) {
switch columns[i] {
case station.FieldVisibleTabs:
values[i] = new([]byte)
case station.FieldIsBuiltin, station.FieldHasDock:
case station.FieldIsBuiltin:
values[i] = new(sql.NullBool)
case station.FieldID, station.FieldStationNo, station.FieldFlowId:
values[i] = new(sql.NullInt64)
case station.FieldName, station.FieldStationType, station.FieldStatus, station.FieldDockCode:
case station.FieldName, station.FieldStationType, station.FieldStatus:
values[i] = new(sql.NullString)
case station.FieldCreatedAt:
values[i] = new(sql.NullTime)
@@ -113,18 +109,6 @@ func (_m *Station) assignValues(columns []string, values []any) error {
} else if value.Valid {
_m.IsBuiltin = value.Bool
}
case station.FieldHasDock:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field hasDock", values[i])
} else if value.Valid {
_m.HasDock = value.Bool
}
case station.FieldDockCode:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field dockCode", values[i])
} else if value.Valid {
_m.DockCode = value.String
}
case station.FieldVisibleTabs:
if value, ok := values[i].(*[]byte); !ok {
return fmt.Errorf("unexpected type %T for field visibleTabs", values[i])
@@ -193,12 +177,6 @@ func (_m *Station) String() string {
builder.WriteString("isBuiltin=")
builder.WriteString(fmt.Sprintf("%v", _m.IsBuiltin))
builder.WriteString(", ")
builder.WriteString("hasDock=")
builder.WriteString(fmt.Sprintf("%v", _m.HasDock))
builder.WriteString(", ")
builder.WriteString("dockCode=")
builder.WriteString(_m.DockCode)
builder.WriteString(", ")
builder.WriteString("visibleTabs=")
builder.WriteString(fmt.Sprintf("%v", _m.VisibleTabs))
builder.WriteString(", ")