新增扫码中间件支持网络型扫码枪键盘注入,AGV 对接从 WMS 迁至 MES 统一管理;新增拧紧不合格人工处置与 PLC 对账机制,优化退库单关联与工位终端功能,同时清理旧 AGV 任务表,完善数据库与配置项。
241 lines
8.5 KiB
Go
241 lines
8.5 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"bj_power_mes/ent/callpool"
|
|
"fmt"
|
|
"strings"
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
// CallPool 叫料池:工位级物料行四数账(需求/调整/已发/占用),来源=启用状态日排产
|
|
type CallPool struct {
|
|
config `json:"-"`
|
|
// ID of the ent.
|
|
ID int `json:"id,omitempty"`
|
|
// 工位号
|
|
StationNo int `json:"stationNo,omitempty"`
|
|
// 物料编码(图号)
|
|
MaterialCode string `json:"materialCode,omitempty"`
|
|
// MaterialName holds the value of the "materialName" field.
|
|
MaterialName string `json:"materialName,omitempty"`
|
|
// Unit holds the value of the "unit" field.
|
|
Unit string `json:"unit,omitempty"`
|
|
// SnMode holds the value of the "snMode" field.
|
|
SnMode int `json:"snMode,omitempty"`
|
|
// 需求量(启用排产派生,逐行向上取整后合计)
|
|
ReqQty int `json:"reqQty,omitempty"`
|
|
// 人工调整量(可正可负;改动留痕 event_log)
|
|
AdjQty int `json:"adjQty,omitempty"`
|
|
// 已发净额(完成备料实发累加;退库收回扣减回补)
|
|
SentQty int `json:"sentQty,omitempty"`
|
|
// 占用中(待备料叫料单请求量合计)
|
|
ReservedQty int `json:"reservedQty,omitempty"`
|
|
// 是否含非今日排产(跨日叫料预警/仓库驳回异常标记)
|
|
CrossDay bool `json:"crossDay,omitempty"`
|
|
// 派生快照:贡献需求的排产日期(逗号分隔,可空)
|
|
PlanDates string `json:"planDates,omitempty"`
|
|
// CreatedAt holds the value of the "createdAt" field.
|
|
CreatedAt time.Time `json:"createdAt,omitempty"`
|
|
// UpdatedAt holds the value of the "updatedAt" field.
|
|
UpdatedAt time.Time `json:"updatedAt,omitempty"`
|
|
selectValues sql.SelectValues
|
|
}
|
|
|
|
// scanValues returns the types for scanning values from sql.Rows.
|
|
func (*CallPool) scanValues(columns []string) ([]any, error) {
|
|
values := make([]any, len(columns))
|
|
for i := range columns {
|
|
switch columns[i] {
|
|
case callpool.FieldCrossDay:
|
|
values[i] = new(sql.NullBool)
|
|
case callpool.FieldID, callpool.FieldStationNo, callpool.FieldSnMode, callpool.FieldReqQty, callpool.FieldAdjQty, callpool.FieldSentQty, callpool.FieldReservedQty:
|
|
values[i] = new(sql.NullInt64)
|
|
case callpool.FieldMaterialCode, callpool.FieldMaterialName, callpool.FieldUnit, callpool.FieldPlanDates:
|
|
values[i] = new(sql.NullString)
|
|
case callpool.FieldCreatedAt, callpool.FieldUpdatedAt:
|
|
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 CallPool fields.
|
|
func (_m *CallPool) 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 callpool.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 callpool.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 callpool.FieldMaterialCode:
|
|
if value, ok := values[i].(*sql.NullString); !ok {
|
|
return fmt.Errorf("unexpected type %T for field materialCode", values[i])
|
|
} else if value.Valid {
|
|
_m.MaterialCode = value.String
|
|
}
|
|
case callpool.FieldMaterialName:
|
|
if value, ok := values[i].(*sql.NullString); !ok {
|
|
return fmt.Errorf("unexpected type %T for field materialName", values[i])
|
|
} else if value.Valid {
|
|
_m.MaterialName = value.String
|
|
}
|
|
case callpool.FieldUnit:
|
|
if value, ok := values[i].(*sql.NullString); !ok {
|
|
return fmt.Errorf("unexpected type %T for field unit", values[i])
|
|
} else if value.Valid {
|
|
_m.Unit = value.String
|
|
}
|
|
case callpool.FieldSnMode:
|
|
if value, ok := values[i].(*sql.NullInt64); !ok {
|
|
return fmt.Errorf("unexpected type %T for field snMode", values[i])
|
|
} else if value.Valid {
|
|
_m.SnMode = int(value.Int64)
|
|
}
|
|
case callpool.FieldReqQty:
|
|
if value, ok := values[i].(*sql.NullInt64); !ok {
|
|
return fmt.Errorf("unexpected type %T for field reqQty", values[i])
|
|
} else if value.Valid {
|
|
_m.ReqQty = int(value.Int64)
|
|
}
|
|
case callpool.FieldAdjQty:
|
|
if value, ok := values[i].(*sql.NullInt64); !ok {
|
|
return fmt.Errorf("unexpected type %T for field adjQty", values[i])
|
|
} else if value.Valid {
|
|
_m.AdjQty = int(value.Int64)
|
|
}
|
|
case callpool.FieldSentQty:
|
|
if value, ok := values[i].(*sql.NullInt64); !ok {
|
|
return fmt.Errorf("unexpected type %T for field sentQty", values[i])
|
|
} else if value.Valid {
|
|
_m.SentQty = int(value.Int64)
|
|
}
|
|
case callpool.FieldReservedQty:
|
|
if value, ok := values[i].(*sql.NullInt64); !ok {
|
|
return fmt.Errorf("unexpected type %T for field reservedQty", values[i])
|
|
} else if value.Valid {
|
|
_m.ReservedQty = int(value.Int64)
|
|
}
|
|
case callpool.FieldCrossDay:
|
|
if value, ok := values[i].(*sql.NullBool); !ok {
|
|
return fmt.Errorf("unexpected type %T for field crossDay", values[i])
|
|
} else if value.Valid {
|
|
_m.CrossDay = value.Bool
|
|
}
|
|
case callpool.FieldPlanDates:
|
|
if value, ok := values[i].(*sql.NullString); !ok {
|
|
return fmt.Errorf("unexpected type %T for field planDates", values[i])
|
|
} else if value.Valid {
|
|
_m.PlanDates = value.String
|
|
}
|
|
case callpool.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
|
|
}
|
|
case callpool.FieldUpdatedAt:
|
|
if value, ok := values[i].(*sql.NullTime); !ok {
|
|
return fmt.Errorf("unexpected type %T for field updatedAt", values[i])
|
|
} else if value.Valid {
|
|
_m.UpdatedAt = 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 CallPool.
|
|
// This includes values selected through modifiers, order, etc.
|
|
func (_m *CallPool) Value(name string) (ent.Value, error) {
|
|
return _m.selectValues.Get(name)
|
|
}
|
|
|
|
// Update returns a builder for updating this CallPool.
|
|
// Note that you need to call CallPool.Unwrap() before calling this method if this CallPool
|
|
// was returned from a transaction, and the transaction was committed or rolled back.
|
|
func (_m *CallPool) Update() *CallPoolUpdateOne {
|
|
return NewCallPoolClient(_m.config).UpdateOne(_m)
|
|
}
|
|
|
|
// Unwrap unwraps the CallPool 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 *CallPool) Unwrap() *CallPool {
|
|
_tx, ok := _m.config.driver.(*txDriver)
|
|
if !ok {
|
|
panic("ent: CallPool is not a transactional entity")
|
|
}
|
|
_m.config.driver = _tx.drv
|
|
return _m
|
|
}
|
|
|
|
// String implements the fmt.Stringer.
|
|
func (_m *CallPool) String() string {
|
|
var builder strings.Builder
|
|
builder.WriteString("CallPool(")
|
|
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
|
|
builder.WriteString("stationNo=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.StationNo))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("materialCode=")
|
|
builder.WriteString(_m.MaterialCode)
|
|
builder.WriteString(", ")
|
|
builder.WriteString("materialName=")
|
|
builder.WriteString(_m.MaterialName)
|
|
builder.WriteString(", ")
|
|
builder.WriteString("unit=")
|
|
builder.WriteString(_m.Unit)
|
|
builder.WriteString(", ")
|
|
builder.WriteString("snMode=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.SnMode))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("reqQty=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.ReqQty))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("adjQty=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.AdjQty))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("sentQty=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.SentQty))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("reservedQty=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.ReservedQty))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("crossDay=")
|
|
builder.WriteString(fmt.Sprintf("%v", _m.CrossDay))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("planDates=")
|
|
builder.WriteString(_m.PlanDates)
|
|
builder.WriteString(", ")
|
|
builder.WriteString("createdAt=")
|
|
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
|
|
builder.WriteString(", ")
|
|
builder.WriteString("updatedAt=")
|
|
builder.WriteString(_m.UpdatedAt.Format(time.ANSIC))
|
|
builder.WriteByte(')')
|
|
return builder.String()
|
|
}
|
|
|
|
// CallPools is a parsable slice of CallPool.
|
|
type CallPools []*CallPool
|