Files
bj_power/bj_power_mes/ent/agvvehiclestate.go
T
SunYF 46fcb59079 feat: 退料闭环定稿(损耗台账/备料清单/退料AGV自动派车/剩余量参考)+ 工位托盘守卫
- MES 新增损耗台账 loss_ledger,差异确认损耗接口 ConfirmReceiveLoss(按工单归集)
- 备料清单 preparation:MES 按 日计划×工单×工位×物料 实时计算,WMS 只读展示 PreparationList
- 退料闭环:N5 工位托盘守卫(未完成禁止退料)、退料 AGV 自动派车(JBT21 空位判定 + 托盘回收链路)、退料参考剩余量接口(应剩余=实备-已耗-已退-已损)
- 新增 AGV 车辆状态表 agv_vehicle_state 及查询
- 整合接驳台/叫料池/库存锁既有闭环,清理 sql 目录注释生成脚本与 catalog,更新文档
2026-11-04 19:06:03 +08:00

161 lines
5.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Code generated by ent, DO NOT EDIT.
package ent
import (
"bj_power_mes/ent/agvvehiclestate"
"fmt"
"strings"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
)
// AgvVehicleState AGV 载货状态台账:按 agv_code 逐台记录有托盘/空车,取货/卸货确认与人工维护写入,派车防撞校验消费。
type AgvVehicleState struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// 车辆编号(RCS robotCode/agvCode;RCS 未分车时=DEFAULT 未知车辆)
AgvCode string `json:"agv_code,omitempty"`
// 载货状态:true=有托盘(载货) false=空车
HasPallet bool `json:"has_pallet,omitempty"`
// 状态来源:AUTO_LOAD取货确认/AUTO_UNLOAD卸货确认/MANUAL人工维护
Source string `json:"source,omitempty"`
// 最近更新人
UpdatedBy string `json:"updated_by,omitempty"`
// 最近更新时间 unix秒
UpdatedAt int64 `json:"updated_at,omitempty"`
// 备注(人工修改原因等)
Remark string `json:"remark,omitempty"`
selectValues sql.SelectValues
}
// scanValues returns the types for scanning values from sql.Rows.
func (*AgvVehicleState) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case agvvehiclestate.FieldHasPallet:
values[i] = new(sql.NullBool)
case agvvehiclestate.FieldID, agvvehiclestate.FieldUpdatedAt:
values[i] = new(sql.NullInt64)
case agvvehiclestate.FieldAgvCode, agvvehiclestate.FieldSource, agvvehiclestate.FieldUpdatedBy, agvvehiclestate.FieldRemark:
values[i] = new(sql.NullString)
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the AgvVehicleState fields.
func (_m *AgvVehicleState) 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 agvvehiclestate.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 agvvehiclestate.FieldAgvCode:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field agv_code", values[i])
} else if value.Valid {
_m.AgvCode = value.String
}
case agvvehiclestate.FieldHasPallet:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field has_pallet", values[i])
} else if value.Valid {
_m.HasPallet = value.Bool
}
case agvvehiclestate.FieldSource:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field source", values[i])
} else if value.Valid {
_m.Source = value.String
}
case agvvehiclestate.FieldUpdatedBy:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field updated_by", values[i])
} else if value.Valid {
_m.UpdatedBy = value.String
}
case agvvehiclestate.FieldUpdatedAt:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
} else if value.Valid {
_m.UpdatedAt = value.Int64
}
case agvvehiclestate.FieldRemark:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field remark", values[i])
} else if value.Valid {
_m.Remark = value.String
}
default:
_m.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the AgvVehicleState.
// This includes values selected through modifiers, order, etc.
func (_m *AgvVehicleState) Value(name string) (ent.Value, error) {
return _m.selectValues.Get(name)
}
// Update returns a builder for updating this AgvVehicleState.
// Note that you need to call AgvVehicleState.Unwrap() before calling this method if this AgvVehicleState
// was returned from a transaction, and the transaction was committed or rolled back.
func (_m *AgvVehicleState) Update() *AgvVehicleStateUpdateOne {
return NewAgvVehicleStateClient(_m.config).UpdateOne(_m)
}
// Unwrap unwraps the AgvVehicleState 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 *AgvVehicleState) Unwrap() *AgvVehicleState {
_tx, ok := _m.config.driver.(*txDriver)
if !ok {
panic("ent: AgvVehicleState is not a transactional entity")
}
_m.config.driver = _tx.drv
return _m
}
// String implements the fmt.Stringer.
func (_m *AgvVehicleState) String() string {
var builder strings.Builder
builder.WriteString("AgvVehicleState(")
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
builder.WriteString("agv_code=")
builder.WriteString(_m.AgvCode)
builder.WriteString(", ")
builder.WriteString("has_pallet=")
builder.WriteString(fmt.Sprintf("%v", _m.HasPallet))
builder.WriteString(", ")
builder.WriteString("source=")
builder.WriteString(_m.Source)
builder.WriteString(", ")
builder.WriteString("updated_by=")
builder.WriteString(_m.UpdatedBy)
builder.WriteString(", ")
builder.WriteString("updated_at=")
builder.WriteString(fmt.Sprintf("%v", _m.UpdatedAt))
builder.WriteString(", ")
builder.WriteString("remark=")
builder.WriteString(_m.Remark)
builder.WriteByte(')')
return builder.String()
}
// AgvVehicleStates is a parsable slice of AgvVehicleState.
type AgvVehicleStates []*AgvVehicleState