Files
bj_power/bj_power_mes/ent/dock.go
T
SunYF 132c3ed6bd docs(test): 更新电表箱装配业务回归测试文档
- 将文档从代码审计任务转换为端到端业务回归测试链路
- 重新组织文档结构为链路总览、示例数据基线和详细步骤
- 添加完整的业务场景清单涵盖WMS/MES/工位终端三大系统
- 定义统一的测试数据包括产品型号、物料清单、工位派工等
- 提供详细的步骤断言和数量等式验证方法
- 建立贯穿全链路的数据流向和状态变更追踪体系
2026-09-21 10:48:53 +08:00

186 lines
5.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package ent
import (
"bj_power_mes/ent/dock"
"fmt"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
)
// Dock is the model entity for the Dock schema.
type Dock struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// 接驳台编码 DOCK01..21
DockCode string `json:"dockCode,omitempty"`
// 接驳台名称
Name string `json:"name,omitempty"`
// 类型 line产线/store库房/other其他
DockType string `json:"dockType,omitempty"`
// 关联工位号(与工位1:1,非产线为0)
StationNo int `json:"stationNo,omitempty"`
// 当前是否有托盘
HasPallet bool `json:"hasPallet,omitempty"`
// 托盘关联(出库单号/备料单号)
PalletRef string `json:"palletRef,omitempty"`
// Status holds the value of the "status" field.
Status string `json:"status,omitempty"`
// CreatedAt holds the value of the "createdAt" field.
CreatedAt time.Time `json:"createdAt,omitempty"`
selectValues sql.SelectValues
}
// scanValues returns the types for scanning values from sql.Rows.
func (*Dock) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case dock.FieldHasPallet:
values[i] = new(sql.NullBool)
case dock.FieldID, dock.FieldStationNo:
values[i] = new(sql.NullInt64)
case dock.FieldDockCode, dock.FieldName, dock.FieldDockType, dock.FieldPalletRef, dock.FieldStatus:
values[i] = new(sql.NullString)
case dock.FieldCreatedAt:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the Dock fields.
func (_m *Dock) assignValues(columns []string, values []any) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case dock.FieldID:
value, ok := values[i].(*sql.NullInt64)
if !ok {
return fmt.Errorf("unexpected type %T for field id", value)
}
_m.ID = int(value.Int64)
case dock.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 dock.FieldName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field name", values[i])
} else if value.Valid {
_m.Name = value.String
}
case dock.FieldDockType:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field dockType", values[i])
} else if value.Valid {
_m.DockType = value.String
}
case dock.FieldStationNo:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field stationNo", values[i])
} else if value.Valid {
_m.StationNo = int(value.Int64)
}
case dock.FieldHasPallet:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field hasPallet", values[i])
} else if value.Valid {
_m.HasPallet = value.Bool
}
case dock.FieldPalletRef:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field palletRef", values[i])
} else if value.Valid {
_m.PalletRef = value.String
}
case dock.FieldStatus:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field status", values[i])
} else if value.Valid {
_m.Status = value.String
}
case dock.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field createdAt", values[i])
} else if value.Valid {
_m.CreatedAt = value.Time
}
default:
_m.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the Dock.
// This includes values selected through modifiers, order, etc.
func (_m *Dock) Value(name string) (ent.Value, error) {
return _m.selectValues.Get(name)
}
// Update returns a builder for updating this Dock.
// Note that you need to call Dock.Unwrap() before calling this method if this Dock
// was returned from a transaction, and the transaction was committed or rolled back.
func (_m *Dock) Update() *DockUpdateOne {
return NewDockClient(_m.config).UpdateOne(_m)
}
// Unwrap unwraps the Dock entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (_m *Dock) Unwrap() *Dock {
_tx, ok := _m.config.driver.(*txDriver)
if !ok {
panic("ent: Dock is not a transactional entity")
}
_m.config.driver = _tx.drv
return _m
}
// String implements the fmt.Stringer.
func (_m *Dock) String() string {
var builder strings.Builder
builder.WriteString("Dock(")
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
builder.WriteString("dockCode=")
builder.WriteString(_m.DockCode)
builder.WriteString(", ")
builder.WriteString("name=")
builder.WriteString(_m.Name)
builder.WriteString(", ")
builder.WriteString("dockType=")
builder.WriteString(_m.DockType)
builder.WriteString(", ")
builder.WriteString("stationNo=")
builder.WriteString(fmt.Sprintf("%v", _m.StationNo))
builder.WriteString(", ")
builder.WriteString("hasPallet=")
builder.WriteString(fmt.Sprintf("%v", _m.HasPallet))
builder.WriteString(", ")
builder.WriteString("palletRef=")
builder.WriteString(_m.PalletRef)
builder.WriteString(", ")
builder.WriteString("status=")
builder.WriteString(_m.Status)
builder.WriteString(", ")
builder.WriteString("createdAt=")
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}
// Docks is a parsable slice of Dock.
type Docks []*Dock