- MES 新增损耗台账 loss_ledger,差异确认损耗接口 ConfirmReceiveLoss(按工单归集) - 备料清单 preparation:MES 按 日计划×工单×工位×物料 实时计算,WMS 只读展示 PreparationList - 退料闭环:N5 工位托盘守卫(未完成禁止退料)、退料 AGV 自动派车(JBT21 空位判定 + 托盘回收链路)、退料参考剩余量接口(应剩余=实备-已耗-已退-已损) - 新增 AGV 车辆状态表 agv_vehicle_state 及查询 - 整合接驳台/叫料池/库存锁既有闭环,清理 sql 目录注释生成脚本与 catalog,更新文档
197 lines
6.4 KiB
Go
197 lines
6.4 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 接驳台主数据:DOCK01~DOCK20(产线,DOCKn↔工位n)+ JBT21(库房收货;T7 2026-11-03 统一代号)。
|
||
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"`
|
||
// 左右:left=操作员左手边/right=右手边(按操作员朝向区分,下排工位与地图左右相反)
|
||
Side string `json:"side,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.FieldSide, 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.FieldSide:
|
||
if value, ok := values[i].(*sql.NullString); !ok {
|
||
return fmt.Errorf("unexpected type %T for field side", values[i])
|
||
} else if value.Valid {
|
||
_m.Side = value.String
|
||
}
|
||
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("side=")
|
||
builder.WriteString(_m.Side)
|
||
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
|