【全系统 · 接驳台编码终版统一(12-01 用户拍板)】
- 新增 dockcode 包作为唯一真源:工位接驳台 = GW{工位号}{Z|Y}(Z=左/Y=右,工位1~10同一规则,废除左右互换),库房 = JBT21 不变
- 编码即海康 RCS 地图点位码:落库/界面/下发 RCS/读 PLC 传感器全用同一套;旧 DOCK01~20 全量废弃,系统内无第二套编号、无换算层
- dock 表去 side 字段;agv_task.target_dock、line_point、看板点位态与中文名、dockLabel 工具全部改 GW 规则
- 产线布局说明.md 同步终版(图纸名 GxZ/GxY 与 AGV 码 GWxZ/GWxY 一一对应;注明 RCS 图与主线流向图相差 180°,读图一律以 GW 码为准)
【MES · 签字模型二次重构(11-30 实测后定稿)】
- _OPERATOR 签字整体废除:工艺步骤删 needOperatorSign / needAudit / auditRole 字段,签字角色改 CALL(工人报检呼叫)+ INSPECTOR(检验员审核签)
- 呼叫时落步骤录入快照(stepValue/stepText/stepChecked/processId),供检验员查看与指纹比对;「待签任务」只认检验员签名步骤
- 「签字复核」(AuditPending 页面 + produce.audit 菜单 + 路由)整套删除
【MES · 台账续流根因修复(11-30 对账发现)】
- 流转目标「G6」与 line_point.point_no「6」对不上导致到位落账查不到、却先释放源位→工件从调度消失;新增 ledgerPointByTarget 归一
- settleDirect/settleInTransit 改为先占目标位、成功才释放源位;目标被占原样保留,工件进缓存位排队(实测 C2 排队不再丢件)
【WMS · 末级库位强校验与上架移库】
- 新增 LocationCascade 四级联动选择器(区/架/层/号,只从启用 level=4 节点派生);手工入库、半成品/成品入库、隔离库位一律四级必填且命中启用节点
- 新增上架/移库 relocate:只改四级库位与 updated_at,不动质量状态/数量/锁定量;不合格与锁定行同样允许移库;支持 ids 逐行指定或 scope 按物料+原库位整组搬
- MES 新增 WMS 自动回流库位配置(半成品/成品各一组末级库位,默认值 1区/1架/1层/1号,存 sys_config 可改)
【MES · 统一口径与工程整改】
- 新增 workpiece_location:工单详情工件列表/WIP/追溯三处共用位置判定(SCRAPPED→DONE→SEMI_STORED→在 StationNo→在途→待流转)
- 新增 workorder_close_warn:工单完工/取消时汇总各工位实物余料出一条预警,不阻断关单
- 分页下沉:新增 pagination 工具,同步失败台账(两端)改 Count+LIMIT/OFFSET 真分页,列表不再全量切片
- 全网对账/孤儿扫描(问题临时.md 第25/26节):10 类关系边断言实测,给出 8 条可重复巡检项
【文档】
- 产线布局说明.md 按 GW 编码终版重写;问题临时.md 新增 24.7 闭环实测、25 全网对账、26 补料→配送→报工人库闭环
534 lines
15 KiB
Go
534 lines
15 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"bj_power_mes/ent/dock"
|
|
"bj_power_mes/ent/predicate"
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// DockUpdate is the builder for updating Dock entities.
|
|
type DockUpdate struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *DockMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// Where appends a list predicates to the DockUpdate builder.
|
|
func (_u *DockUpdate) Where(ps ...predicate.Dock) *DockUpdate {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// SetDockCode sets the "dockCode" field.
|
|
func (_u *DockUpdate) SetDockCode(v string) *DockUpdate {
|
|
_u.mutation.SetDockCode(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDockCode sets the "dockCode" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableDockCode(v *string) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetDockCode(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetName sets the "name" field.
|
|
func (_u *DockUpdate) SetName(v string) *DockUpdate {
|
|
_u.mutation.SetName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableName sets the "name" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableName(v *string) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetDockType sets the "dockType" field.
|
|
func (_u *DockUpdate) SetDockType(v string) *DockUpdate {
|
|
_u.mutation.SetDockType(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDockType sets the "dockType" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableDockType(v *string) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetDockType(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetStationNo sets the "stationNo" field.
|
|
func (_u *DockUpdate) SetStationNo(v int) *DockUpdate {
|
|
_u.mutation.ResetStationNo()
|
|
_u.mutation.SetStationNo(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableStationNo sets the "stationNo" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableStationNo(v *int) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetStationNo(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddStationNo adds value to the "stationNo" field.
|
|
func (_u *DockUpdate) AddStationNo(v int) *DockUpdate {
|
|
_u.mutation.AddStationNo(v)
|
|
return _u
|
|
}
|
|
|
|
// SetHasPallet sets the "hasPallet" field.
|
|
func (_u *DockUpdate) SetHasPallet(v bool) *DockUpdate {
|
|
_u.mutation.SetHasPallet(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableHasPallet sets the "hasPallet" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableHasPallet(v *bool) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetHasPallet(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetPalletRef sets the "palletRef" field.
|
|
func (_u *DockUpdate) SetPalletRef(v string) *DockUpdate {
|
|
_u.mutation.SetPalletRef(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillablePalletRef sets the "palletRef" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillablePalletRef(v *string) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetPalletRef(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearPalletRef clears the value of the "palletRef" field.
|
|
func (_u *DockUpdate) ClearPalletRef() *DockUpdate {
|
|
_u.mutation.ClearPalletRef()
|
|
return _u
|
|
}
|
|
|
|
// SetStatus sets the "status" field.
|
|
func (_u *DockUpdate) SetStatus(v string) *DockUpdate {
|
|
_u.mutation.SetStatus(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableStatus sets the "status" field if the given value is not nil.
|
|
func (_u *DockUpdate) SetNillableStatus(v *string) *DockUpdate {
|
|
if v != nil {
|
|
_u.SetStatus(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// Mutation returns the DockMutation object of the builder.
|
|
func (_u *DockUpdate) Mutation() *DockMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
func (_u *DockUpdate) Save(ctx context.Context) (int, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *DockUpdate) SaveX(ctx context.Context) int {
|
|
affected, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return affected
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (_u *DockUpdate) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *DockUpdate) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *DockUpdate) check() error {
|
|
if v, ok := _u.mutation.DockCode(); ok {
|
|
if err := dock.DockCodeValidator(v); err != nil {
|
|
return &ValidationError{Name: "dockCode", err: fmt.Errorf(`ent: validator failed for field "Dock.dockCode": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Name(); ok {
|
|
if err := dock.NameValidator(v); err != nil {
|
|
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Dock.name": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.DockType(); ok {
|
|
if err := dock.DockTypeValidator(v); err != nil {
|
|
return &ValidationError{Name: "dockType", err: fmt.Errorf(`ent: validator failed for field "Dock.dockType": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.PalletRef(); ok {
|
|
if err := dock.PalletRefValidator(v); err != nil {
|
|
return &ValidationError{Name: "palletRef", err: fmt.Errorf(`ent: validator failed for field "Dock.palletRef": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Status(); ok {
|
|
if err := dock.StatusValidator(v); err != nil {
|
|
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Dock.status": %w`, err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *DockUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DockUpdate {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *DockUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(dock.Table, dock.Columns, sqlgraph.NewFieldSpec(dock.FieldID, field.TypeInt))
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.DockCode(); ok {
|
|
_spec.SetField(dock.FieldDockCode, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Name(); ok {
|
|
_spec.SetField(dock.FieldName, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.DockType(); ok {
|
|
_spec.SetField(dock.FieldDockType, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.StationNo(); ok {
|
|
_spec.SetField(dock.FieldStationNo, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.AddedStationNo(); ok {
|
|
_spec.AddField(dock.FieldStationNo, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.HasPallet(); ok {
|
|
_spec.SetField(dock.FieldHasPallet, field.TypeBool, value)
|
|
}
|
|
if value, ok := _u.mutation.PalletRef(); ok {
|
|
_spec.SetField(dock.FieldPalletRef, field.TypeString, value)
|
|
}
|
|
if _u.mutation.PalletRefCleared() {
|
|
_spec.ClearField(dock.FieldPalletRef, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Status(); ok {
|
|
_spec.SetField(dock.FieldStatus, field.TypeString, value)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{dock.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return 0, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|
|
|
|
// DockUpdateOne is the builder for updating a single Dock entity.
|
|
type DockUpdateOne struct {
|
|
config
|
|
fields []string
|
|
hooks []Hook
|
|
mutation *DockMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// SetDockCode sets the "dockCode" field.
|
|
func (_u *DockUpdateOne) SetDockCode(v string) *DockUpdateOne {
|
|
_u.mutation.SetDockCode(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDockCode sets the "dockCode" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableDockCode(v *string) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetDockCode(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetName sets the "name" field.
|
|
func (_u *DockUpdateOne) SetName(v string) *DockUpdateOne {
|
|
_u.mutation.SetName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableName sets the "name" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableName(v *string) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetDockType sets the "dockType" field.
|
|
func (_u *DockUpdateOne) SetDockType(v string) *DockUpdateOne {
|
|
_u.mutation.SetDockType(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDockType sets the "dockType" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableDockType(v *string) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetDockType(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetStationNo sets the "stationNo" field.
|
|
func (_u *DockUpdateOne) SetStationNo(v int) *DockUpdateOne {
|
|
_u.mutation.ResetStationNo()
|
|
_u.mutation.SetStationNo(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableStationNo sets the "stationNo" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableStationNo(v *int) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetStationNo(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddStationNo adds value to the "stationNo" field.
|
|
func (_u *DockUpdateOne) AddStationNo(v int) *DockUpdateOne {
|
|
_u.mutation.AddStationNo(v)
|
|
return _u
|
|
}
|
|
|
|
// SetHasPallet sets the "hasPallet" field.
|
|
func (_u *DockUpdateOne) SetHasPallet(v bool) *DockUpdateOne {
|
|
_u.mutation.SetHasPallet(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableHasPallet sets the "hasPallet" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableHasPallet(v *bool) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetHasPallet(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetPalletRef sets the "palletRef" field.
|
|
func (_u *DockUpdateOne) SetPalletRef(v string) *DockUpdateOne {
|
|
_u.mutation.SetPalletRef(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillablePalletRef sets the "palletRef" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillablePalletRef(v *string) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetPalletRef(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearPalletRef clears the value of the "palletRef" field.
|
|
func (_u *DockUpdateOne) ClearPalletRef() *DockUpdateOne {
|
|
_u.mutation.ClearPalletRef()
|
|
return _u
|
|
}
|
|
|
|
// SetStatus sets the "status" field.
|
|
func (_u *DockUpdateOne) SetStatus(v string) *DockUpdateOne {
|
|
_u.mutation.SetStatus(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableStatus sets the "status" field if the given value is not nil.
|
|
func (_u *DockUpdateOne) SetNillableStatus(v *string) *DockUpdateOne {
|
|
if v != nil {
|
|
_u.SetStatus(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// Mutation returns the DockMutation object of the builder.
|
|
func (_u *DockUpdateOne) Mutation() *DockMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// Where appends a list predicates to the DockUpdate builder.
|
|
func (_u *DockUpdateOne) Where(ps ...predicate.Dock) *DockUpdateOne {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// Select allows selecting one or more fields (columns) of the returned entity.
|
|
// The default is selecting all fields defined in the entity schema.
|
|
func (_u *DockUpdateOne) Select(field string, fields ...string) *DockUpdateOne {
|
|
_u.fields = append([]string{field}, fields...)
|
|
return _u
|
|
}
|
|
|
|
// Save executes the query and returns the updated Dock entity.
|
|
func (_u *DockUpdateOne) Save(ctx context.Context) (*Dock, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *DockUpdateOne) SaveX(ctx context.Context) *Dock {
|
|
node, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return node
|
|
}
|
|
|
|
// Exec executes the query on the entity.
|
|
func (_u *DockUpdateOne) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *DockUpdateOne) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *DockUpdateOne) check() error {
|
|
if v, ok := _u.mutation.DockCode(); ok {
|
|
if err := dock.DockCodeValidator(v); err != nil {
|
|
return &ValidationError{Name: "dockCode", err: fmt.Errorf(`ent: validator failed for field "Dock.dockCode": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Name(); ok {
|
|
if err := dock.NameValidator(v); err != nil {
|
|
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Dock.name": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.DockType(); ok {
|
|
if err := dock.DockTypeValidator(v); err != nil {
|
|
return &ValidationError{Name: "dockType", err: fmt.Errorf(`ent: validator failed for field "Dock.dockType": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.PalletRef(); ok {
|
|
if err := dock.PalletRefValidator(v); err != nil {
|
|
return &ValidationError{Name: "palletRef", err: fmt.Errorf(`ent: validator failed for field "Dock.palletRef": %w`, err)}
|
|
}
|
|
}
|
|
if v, ok := _u.mutation.Status(); ok {
|
|
if err := dock.StatusValidator(v); err != nil {
|
|
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Dock.status": %w`, err)}
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *DockUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DockUpdateOne {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *DockUpdateOne) sqlSave(ctx context.Context) (_node *Dock, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(dock.Table, dock.Columns, sqlgraph.NewFieldSpec(dock.FieldID, field.TypeInt))
|
|
id, ok := _u.mutation.ID()
|
|
if !ok {
|
|
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Dock.id" for update`)}
|
|
}
|
|
_spec.Node.ID.Value = id
|
|
if fields := _u.fields; len(fields) > 0 {
|
|
_spec.Node.Columns = make([]string, 0, len(fields))
|
|
_spec.Node.Columns = append(_spec.Node.Columns, dock.FieldID)
|
|
for _, f := range fields {
|
|
if !dock.ValidColumn(f) {
|
|
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
|
}
|
|
if f != dock.FieldID {
|
|
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
|
}
|
|
}
|
|
}
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.DockCode(); ok {
|
|
_spec.SetField(dock.FieldDockCode, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.Name(); ok {
|
|
_spec.SetField(dock.FieldName, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.DockType(); ok {
|
|
_spec.SetField(dock.FieldDockType, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.StationNo(); ok {
|
|
_spec.SetField(dock.FieldStationNo, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.AddedStationNo(); ok {
|
|
_spec.AddField(dock.FieldStationNo, field.TypeInt, value)
|
|
}
|
|
if value, ok := _u.mutation.HasPallet(); ok {
|
|
_spec.SetField(dock.FieldHasPallet, field.TypeBool, value)
|
|
}
|
|
if value, ok := _u.mutation.PalletRef(); ok {
|
|
_spec.SetField(dock.FieldPalletRef, field.TypeString, value)
|
|
}
|
|
if _u.mutation.PalletRefCleared() {
|
|
_spec.ClearField(dock.FieldPalletRef, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Status(); ok {
|
|
_spec.SetField(dock.FieldStatus, field.TypeString, value)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
_node = &Dock{config: _u.config}
|
|
_spec.Assign = _node.assignValues
|
|
_spec.ScanValues = _node.scanValues
|
|
if err = sqlgraph.UpdateNode(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{dock.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return nil, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|