feat: 新增收集式校验错误弹窗及工位报警语音播报
新增 ErrorListDialog 组件用于统一展示结构化校验错误信息,实现报错一次收全;新增工位报警语音播报功能,通过浏览器 SpeechSynthesis 播放本工位相关报警;调整物料类别及序列号字段文案,移除「其他」类别;新增工单实际开始字段及采集方式配置;优化 AGV 及 PlcSend 页签刷新逻辑;新增看板物料追溯及工位报警接口;删除 PLC 强制写 M 位及相关测试代码;同步数据库字段注释及补丁。
This commit is contained in:
@@ -27,7 +27,7 @@ type Material struct {
|
||||
Unit string `json:"unit,omitempty"`
|
||||
// 说明
|
||||
Description string `json:"description,omitempty"`
|
||||
// 物料类别 1原材料/3成品/4其他(半成品不是物料物料类别)
|
||||
// 物料类别 1原材料/3成品(半成品不是物料类别,「其他」已移除)
|
||||
ItemType int `json:"itemType,omitempty"`
|
||||
// 类型 1结构件/2电气件/3其他(仅分类,不决定SN行为)
|
||||
ManageMode int `json:"manageMode,omitempty"`
|
||||
|
||||
@@ -472,7 +472,7 @@ var (
|
||||
{Name: "spec", Type: field.TypeString, Size: 128, Comment: "规格型号", Default: ""},
|
||||
{Name: "unit", Type: field.TypeString, Size: 32, Comment: "计量单位", Default: ""},
|
||||
{Name: "description", Type: field.TypeString, Size: 255, Comment: "说明", Default: ""},
|
||||
{Name: "item_type", Type: field.TypeInt, Comment: "物料类别 1原材料/3成品/4其他(半成品不是物料物料类别)", Default: 1},
|
||||
{Name: "item_type", Type: field.TypeInt, Comment: "物料类别 1原材料/3成品(半成品不是物料类别,「其他」已移除)", Default: 1},
|
||||
{Name: "manage_mode", Type: field.TypeInt, Comment: "类型 1结构件/2电气件/3其他(仅分类,不决定SN行为)", Default: 1},
|
||||
{Name: "sn_mode", Type: field.TypeInt, Comment: "是否逐件SN管理 0未选择(必填)/1序列号=是(录SN)/2序列号=否(不录SN)", Default: 0},
|
||||
{Name: "template_code", Type: field.TypeString, Size: 64, Comment: "模板编码", Default: ""},
|
||||
@@ -698,8 +698,7 @@ var (
|
||||
{Name: "flow_id", Type: field.TypeInt, Nullable: true, Comment: "所属工艺流程图ID"},
|
||||
{Name: "seq", Type: field.TypeInt, Comment: "步骤序号", Default: 1},
|
||||
{Name: "name", Type: field.TypeString, Size: 128, Comment: "步骤名称"},
|
||||
{Name: "collect_type", Type: field.TypeString, Size: 20, Comment: "AUTO/MANUAL/NONE", Default: "NONE"},
|
||||
{Name: "is_torque", Type: field.TypeBool, Comment: "是否拧紧采集", Default: false},
|
||||
{Name: "collect_type", Type: field.TypeString, Size: 20, Comment: "采集方式 AUTO(拧紧枪自动)/MANUAL(手填)/SCAN(扫码,与手填等价采一串字符串)/NONE(仅记录)", Default: "NONE"},
|
||||
{Name: "need_check", Type: field.TypeBool, Comment: "是否需要检测确认(报工前须检验通过)", Default: false},
|
||||
{Name: "need_operator_sign", Type: field.TypeBool, Comment: "是否需要操作工签字(报工前须签字确认)", Default: false},
|
||||
{Name: "need_inspector_sign", Type: field.TypeBool, Comment: "是否需要检验员签字(审核通过并签字后放行)", Default: false},
|
||||
@@ -1142,6 +1141,7 @@ var (
|
||||
{Name: "plan_end", Type: field.TypeTime, Nullable: true, Comment: "计划结束"},
|
||||
{Name: "context", Type: field.TypeJSON, Nullable: true, Comment: "扩展字段", SchemaType: map[string]string{"postgres": "jsonb"}},
|
||||
{Name: "completed_at", Type: field.TypeTime, Nullable: true},
|
||||
{Name: "actual_start", Type: field.TypeTime, Nullable: true, Comment: "实际开始"},
|
||||
{Name: "created_at", Type: field.TypeTime},
|
||||
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
|
||||
}
|
||||
|
||||
@@ -18845,7 +18845,6 @@ type ProcessStepMutation struct {
|
||||
addseq *int
|
||||
name *string
|
||||
collectType *string
|
||||
isTorque *bool
|
||||
needCheck *bool
|
||||
needOperatorSign *bool
|
||||
needInspectorSign *bool
|
||||
@@ -19163,42 +19162,6 @@ func (m *ProcessStepMutation) ResetCollectType() {
|
||||
m.collectType = nil
|
||||
}
|
||||
|
||||
// SetIsTorque sets the "isTorque" field.
|
||||
func (m *ProcessStepMutation) SetIsTorque(b bool) {
|
||||
m.isTorque = &b
|
||||
}
|
||||
|
||||
// IsTorque returns the value of the "isTorque" field in the mutation.
|
||||
func (m *ProcessStepMutation) IsTorque() (r bool, exists bool) {
|
||||
v := m.isTorque
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldIsTorque returns the old "isTorque" field's value of the ProcessStep entity.
|
||||
// If the ProcessStep object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *ProcessStepMutation) OldIsTorque(ctx context.Context) (v bool, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldIsTorque is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldIsTorque requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldIsTorque: %w", err)
|
||||
}
|
||||
return oldValue.IsTorque, nil
|
||||
}
|
||||
|
||||
// ResetIsTorque resets all changes to the "isTorque" field.
|
||||
func (m *ProcessStepMutation) ResetIsTorque() {
|
||||
m.isTorque = nil
|
||||
}
|
||||
|
||||
// SetNeedCheck sets the "needCheck" field.
|
||||
func (m *ProcessStepMutation) SetNeedCheck(b bool) {
|
||||
m.needCheck = &b
|
||||
@@ -19563,7 +19526,7 @@ func (m *ProcessStepMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *ProcessStepMutation) Fields() []string {
|
||||
fields := make([]string, 0, 13)
|
||||
fields := make([]string, 0, 12)
|
||||
if m.flowId != nil {
|
||||
fields = append(fields, processstep.FieldFlowId)
|
||||
}
|
||||
@@ -19576,9 +19539,6 @@ func (m *ProcessStepMutation) Fields() []string {
|
||||
if m.collectType != nil {
|
||||
fields = append(fields, processstep.FieldCollectType)
|
||||
}
|
||||
if m.isTorque != nil {
|
||||
fields = append(fields, processstep.FieldIsTorque)
|
||||
}
|
||||
if m.needCheck != nil {
|
||||
fields = append(fields, processstep.FieldNeedCheck)
|
||||
}
|
||||
@@ -19619,8 +19579,6 @@ func (m *ProcessStepMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Name()
|
||||
case processstep.FieldCollectType:
|
||||
return m.CollectType()
|
||||
case processstep.FieldIsTorque:
|
||||
return m.IsTorque()
|
||||
case processstep.FieldNeedCheck:
|
||||
return m.NeedCheck()
|
||||
case processstep.FieldNeedOperatorSign:
|
||||
@@ -19654,8 +19612,6 @@ func (m *ProcessStepMutation) OldField(ctx context.Context, name string) (ent.Va
|
||||
return m.OldName(ctx)
|
||||
case processstep.FieldCollectType:
|
||||
return m.OldCollectType(ctx)
|
||||
case processstep.FieldIsTorque:
|
||||
return m.OldIsTorque(ctx)
|
||||
case processstep.FieldNeedCheck:
|
||||
return m.OldNeedCheck(ctx)
|
||||
case processstep.FieldNeedOperatorSign:
|
||||
@@ -19709,13 +19665,6 @@ func (m *ProcessStepMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetCollectType(v)
|
||||
return nil
|
||||
case processstep.FieldIsTorque:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetIsTorque(v)
|
||||
return nil
|
||||
case processstep.FieldNeedCheck:
|
||||
v, ok := value.(bool)
|
||||
if !ok {
|
||||
@@ -19881,9 +19830,6 @@ func (m *ProcessStepMutation) ResetField(name string) error {
|
||||
case processstep.FieldCollectType:
|
||||
m.ResetCollectType()
|
||||
return nil
|
||||
case processstep.FieldIsTorque:
|
||||
m.ResetIsTorque()
|
||||
return nil
|
||||
case processstep.FieldNeedCheck:
|
||||
m.ResetNeedCheck()
|
||||
return nil
|
||||
@@ -30438,6 +30384,7 @@ type WorkOrderMutation struct {
|
||||
planEnd *time.Time
|
||||
context *map[string]interface{}
|
||||
completedAt *time.Time
|
||||
actualStart *time.Time
|
||||
createdAt *time.Time
|
||||
updatedAt *time.Time
|
||||
clearedFields map[string]struct{}
|
||||
@@ -31464,6 +31411,55 @@ func (m *WorkOrderMutation) ResetCompletedAt() {
|
||||
delete(m.clearedFields, workorder.FieldCompletedAt)
|
||||
}
|
||||
|
||||
// SetActualStart sets the "actualStart" field.
|
||||
func (m *WorkOrderMutation) SetActualStart(t time.Time) {
|
||||
m.actualStart = &t
|
||||
}
|
||||
|
||||
// ActualStart returns the value of the "actualStart" field in the mutation.
|
||||
func (m *WorkOrderMutation) ActualStart() (r time.Time, exists bool) {
|
||||
v := m.actualStart
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldActualStart returns the old "actualStart" field's value of the WorkOrder entity.
|
||||
// If the WorkOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *WorkOrderMutation) OldActualStart(ctx context.Context) (v *time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldActualStart is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldActualStart requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldActualStart: %w", err)
|
||||
}
|
||||
return oldValue.ActualStart, nil
|
||||
}
|
||||
|
||||
// ClearActualStart clears the value of the "actualStart" field.
|
||||
func (m *WorkOrderMutation) ClearActualStart() {
|
||||
m.actualStart = nil
|
||||
m.clearedFields[workorder.FieldActualStart] = struct{}{}
|
||||
}
|
||||
|
||||
// ActualStartCleared returns if the "actualStart" field was cleared in this mutation.
|
||||
func (m *WorkOrderMutation) ActualStartCleared() bool {
|
||||
_, ok := m.clearedFields[workorder.FieldActualStart]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetActualStart resets all changes to the "actualStart" field.
|
||||
func (m *WorkOrderMutation) ResetActualStart() {
|
||||
m.actualStart = nil
|
||||
delete(m.clearedFields, workorder.FieldActualStart)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "createdAt" field.
|
||||
func (m *WorkOrderMutation) SetCreatedAt(t time.Time) {
|
||||
m.createdAt = &t
|
||||
@@ -31583,7 +31579,7 @@ func (m *WorkOrderMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *WorkOrderMutation) Fields() []string {
|
||||
fields := make([]string, 0, 22)
|
||||
fields := make([]string, 0, 23)
|
||||
if m.workOrderNo != nil {
|
||||
fields = append(fields, workorder.FieldWorkOrderNo)
|
||||
}
|
||||
@@ -31644,6 +31640,9 @@ func (m *WorkOrderMutation) Fields() []string {
|
||||
if m.completedAt != nil {
|
||||
fields = append(fields, workorder.FieldCompletedAt)
|
||||
}
|
||||
if m.actualStart != nil {
|
||||
fields = append(fields, workorder.FieldActualStart)
|
||||
}
|
||||
if m.createdAt != nil {
|
||||
fields = append(fields, workorder.FieldCreatedAt)
|
||||
}
|
||||
@@ -31698,6 +31697,8 @@ func (m *WorkOrderMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.Context()
|
||||
case workorder.FieldCompletedAt:
|
||||
return m.CompletedAt()
|
||||
case workorder.FieldActualStart:
|
||||
return m.ActualStart()
|
||||
case workorder.FieldCreatedAt:
|
||||
return m.CreatedAt()
|
||||
case workorder.FieldUpdatedAt:
|
||||
@@ -31751,6 +31752,8 @@ func (m *WorkOrderMutation) OldField(ctx context.Context, name string) (ent.Valu
|
||||
return m.OldContext(ctx)
|
||||
case workorder.FieldCompletedAt:
|
||||
return m.OldCompletedAt(ctx)
|
||||
case workorder.FieldActualStart:
|
||||
return m.OldActualStart(ctx)
|
||||
case workorder.FieldCreatedAt:
|
||||
return m.OldCreatedAt(ctx)
|
||||
case workorder.FieldUpdatedAt:
|
||||
@@ -31904,6 +31907,13 @@ func (m *WorkOrderMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetCompletedAt(v)
|
||||
return nil
|
||||
case workorder.FieldActualStart:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetActualStart(v)
|
||||
return nil
|
||||
case workorder.FieldCreatedAt:
|
||||
v, ok := value.(time.Time)
|
||||
if !ok {
|
||||
@@ -32029,6 +32039,9 @@ func (m *WorkOrderMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(workorder.FieldCompletedAt) {
|
||||
fields = append(fields, workorder.FieldCompletedAt)
|
||||
}
|
||||
if m.FieldCleared(workorder.FieldActualStart) {
|
||||
fields = append(fields, workorder.FieldActualStart)
|
||||
}
|
||||
if m.FieldCleared(workorder.FieldUpdatedAt) {
|
||||
fields = append(fields, workorder.FieldUpdatedAt)
|
||||
}
|
||||
@@ -32064,6 +32077,9 @@ func (m *WorkOrderMutation) ClearField(name string) error {
|
||||
case workorder.FieldCompletedAt:
|
||||
m.ClearCompletedAt()
|
||||
return nil
|
||||
case workorder.FieldActualStart:
|
||||
m.ClearActualStart()
|
||||
return nil
|
||||
case workorder.FieldUpdatedAt:
|
||||
m.ClearUpdatedAt()
|
||||
return nil
|
||||
@@ -32135,6 +32151,9 @@ func (m *WorkOrderMutation) ResetField(name string) error {
|
||||
case workorder.FieldCompletedAt:
|
||||
m.ResetCompletedAt()
|
||||
return nil
|
||||
case workorder.FieldActualStart:
|
||||
m.ResetActualStart()
|
||||
return nil
|
||||
case workorder.FieldCreatedAt:
|
||||
m.ResetCreatedAt()
|
||||
return nil
|
||||
|
||||
@@ -24,10 +24,8 @@ type ProcessStep struct {
|
||||
Seq int `json:"seq,omitempty"`
|
||||
// 步骤名称
|
||||
Name string `json:"name,omitempty"`
|
||||
// AUTO/MANUAL/NONE
|
||||
// 采集方式 AUTO(拧紧枪自动)/MANUAL(手填)/SCAN(扫码,与手填等价采一串字符串)/NONE(仅记录)
|
||||
CollectType string `json:"collectType,omitempty"`
|
||||
// 是否拧紧采集
|
||||
IsTorque bool `json:"isTorque,omitempty"`
|
||||
// 是否需要检测确认(报工前须检验通过)
|
||||
NeedCheck bool `json:"needCheck,omitempty"`
|
||||
// 是否需要操作工签字(报工前须签字确认)
|
||||
@@ -54,7 +52,7 @@ func (*ProcessStep) scanValues(columns []string) ([]any, error) {
|
||||
switch columns[i] {
|
||||
case processstep.FieldAttachment:
|
||||
values[i] = new([]byte)
|
||||
case processstep.FieldIsTorque, processstep.FieldNeedCheck, processstep.FieldNeedOperatorSign, processstep.FieldNeedInspectorSign, processstep.FieldNeedAudit:
|
||||
case processstep.FieldNeedCheck, processstep.FieldNeedOperatorSign, processstep.FieldNeedInspectorSign, processstep.FieldNeedAudit:
|
||||
values[i] = new(sql.NullBool)
|
||||
case processstep.FieldID, processstep.FieldFlowId, processstep.FieldSeq:
|
||||
values[i] = new(sql.NullInt64)
|
||||
@@ -107,12 +105,6 @@ func (_m *ProcessStep) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.CollectType = value.String
|
||||
}
|
||||
case processstep.FieldIsTorque:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field isTorque", values[i])
|
||||
} else if value.Valid {
|
||||
_m.IsTorque = value.Bool
|
||||
}
|
||||
case processstep.FieldNeedCheck:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field needCheck", values[i])
|
||||
@@ -211,9 +203,6 @@ func (_m *ProcessStep) String() string {
|
||||
builder.WriteString("collectType=")
|
||||
builder.WriteString(_m.CollectType)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("isTorque=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.IsTorque))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("needCheck=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.NeedCheck))
|
||||
builder.WriteString(", ")
|
||||
|
||||
@@ -21,8 +21,6 @@ const (
|
||||
FieldName = "name"
|
||||
// FieldCollectType holds the string denoting the collecttype field in the database.
|
||||
FieldCollectType = "collect_type"
|
||||
// FieldIsTorque holds the string denoting the istorque field in the database.
|
||||
FieldIsTorque = "is_torque"
|
||||
// FieldNeedCheck holds the string denoting the needcheck field in the database.
|
||||
FieldNeedCheck = "need_check"
|
||||
// FieldNeedOperatorSign holds the string denoting the needoperatorsign field in the database.
|
||||
@@ -50,7 +48,6 @@ var Columns = []string{
|
||||
FieldSeq,
|
||||
FieldName,
|
||||
FieldCollectType,
|
||||
FieldIsTorque,
|
||||
FieldNeedCheck,
|
||||
FieldNeedOperatorSign,
|
||||
FieldNeedInspectorSign,
|
||||
@@ -80,8 +77,6 @@ var (
|
||||
DefaultCollectType string
|
||||
// CollectTypeValidator is a validator for the "collectType" field. It is called by the builders before save.
|
||||
CollectTypeValidator func(string) error
|
||||
// DefaultIsTorque holds the default value on creation for the "isTorque" field.
|
||||
DefaultIsTorque bool
|
||||
// DefaultNeedCheck holds the default value on creation for the "needCheck" field.
|
||||
DefaultNeedCheck bool
|
||||
// DefaultNeedOperatorSign holds the default value on creation for the "needOperatorSign" field.
|
||||
@@ -132,11 +127,6 @@ func ByCollectType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCollectType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIsTorque orders the results by the isTorque field.
|
||||
func ByIsTorque(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIsTorque, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNeedCheck orders the results by the needCheck field.
|
||||
func ByNeedCheck(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNeedCheck, opts...).ToFunc()
|
||||
|
||||
@@ -74,11 +74,6 @@ func CollectType(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldCollectType, v))
|
||||
}
|
||||
|
||||
// IsTorque applies equality check predicate on the "isTorque" field. It's identical to IsTorqueEQ.
|
||||
func IsTorque(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldIsTorque, v))
|
||||
}
|
||||
|
||||
// NeedCheck applies equality check predicate on the "needCheck" field. It's identical to NeedCheckEQ.
|
||||
func NeedCheck(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldNeedCheck, v))
|
||||
@@ -334,16 +329,6 @@ func CollectTypeContainsFold(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldContainsFold(FieldCollectType, v))
|
||||
}
|
||||
|
||||
// IsTorqueEQ applies the EQ predicate on the "isTorque" field.
|
||||
func IsTorqueEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldIsTorque, v))
|
||||
}
|
||||
|
||||
// IsTorqueNEQ applies the NEQ predicate on the "isTorque" field.
|
||||
func IsTorqueNEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNEQ(FieldIsTorque, v))
|
||||
}
|
||||
|
||||
// NeedCheckEQ applies the EQ predicate on the "needCheck" field.
|
||||
func NeedCheckEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldNeedCheck, v))
|
||||
|
||||
@@ -68,20 +68,6 @@ func (_c *ProcessStepCreate) SetNillableCollectType(v *string) *ProcessStepCreat
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetIsTorque sets the "isTorque" field.
|
||||
func (_c *ProcessStepCreate) SetIsTorque(v bool) *ProcessStepCreate {
|
||||
_c.mutation.SetIsTorque(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableIsTorque sets the "isTorque" field if the given value is not nil.
|
||||
func (_c *ProcessStepCreate) SetNillableIsTorque(v *bool) *ProcessStepCreate {
|
||||
if v != nil {
|
||||
_c.SetIsTorque(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNeedCheck sets the "needCheck" field.
|
||||
func (_c *ProcessStepCreate) SetNeedCheck(v bool) *ProcessStepCreate {
|
||||
_c.mutation.SetNeedCheck(v)
|
||||
@@ -235,10 +221,6 @@ func (_c *ProcessStepCreate) defaults() {
|
||||
v := processstep.DefaultCollectType
|
||||
_c.mutation.SetCollectType(v)
|
||||
}
|
||||
if _, ok := _c.mutation.IsTorque(); !ok {
|
||||
v := processstep.DefaultIsTorque
|
||||
_c.mutation.SetIsTorque(v)
|
||||
}
|
||||
if _, ok := _c.mutation.NeedCheck(); !ok {
|
||||
v := processstep.DefaultNeedCheck
|
||||
_c.mutation.SetNeedCheck(v)
|
||||
@@ -290,9 +272,6 @@ func (_c *ProcessStepCreate) check() error {
|
||||
return &ValidationError{Name: "collectType", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.collectType": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.IsTorque(); !ok {
|
||||
return &ValidationError{Name: "isTorque", err: errors.New(`ent: missing required field "ProcessStep.isTorque"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.NeedCheck(); !ok {
|
||||
return &ValidationError{Name: "needCheck", err: errors.New(`ent: missing required field "ProcessStep.needCheck"`)}
|
||||
}
|
||||
@@ -374,10 +353,6 @@ func (_c *ProcessStepCreate) createSpec() (*ProcessStep, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(processstep.FieldCollectType, field.TypeString, value)
|
||||
_node.CollectType = value
|
||||
}
|
||||
if value, ok := _c.mutation.IsTorque(); ok {
|
||||
_spec.SetField(processstep.FieldIsTorque, field.TypeBool, value)
|
||||
_node.IsTorque = value
|
||||
}
|
||||
if value, ok := _c.mutation.NeedCheck(); ok {
|
||||
_spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value)
|
||||
_node.NeedCheck = value
|
||||
|
||||
@@ -105,20 +105,6 @@ func (_u *ProcessStepUpdate) SetNillableCollectType(v *string) *ProcessStepUpdat
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetIsTorque sets the "isTorque" field.
|
||||
func (_u *ProcessStepUpdate) SetIsTorque(v bool) *ProcessStepUpdate {
|
||||
_u.mutation.SetIsTorque(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableIsTorque sets the "isTorque" field if the given value is not nil.
|
||||
func (_u *ProcessStepUpdate) SetNillableIsTorque(v *bool) *ProcessStepUpdate {
|
||||
if v != nil {
|
||||
_u.SetIsTorque(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNeedCheck sets the "needCheck" field.
|
||||
func (_u *ProcessStepUpdate) SetNeedCheck(v bool) *ProcessStepUpdate {
|
||||
_u.mutation.SetNeedCheck(v)
|
||||
@@ -323,9 +309,6 @@ func (_u *ProcessStepUpdate) sqlSave(ctx context.Context) (_node int, err error)
|
||||
if value, ok := _u.mutation.CollectType(); ok {
|
||||
_spec.SetField(processstep.FieldCollectType, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.IsTorque(); ok {
|
||||
_spec.SetField(processstep.FieldIsTorque, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.NeedCheck(); ok {
|
||||
_spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value)
|
||||
}
|
||||
@@ -456,20 +439,6 @@ func (_u *ProcessStepUpdateOne) SetNillableCollectType(v *string) *ProcessStepUp
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetIsTorque sets the "isTorque" field.
|
||||
func (_u *ProcessStepUpdateOne) SetIsTorque(v bool) *ProcessStepUpdateOne {
|
||||
_u.mutation.SetIsTorque(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableIsTorque sets the "isTorque" field if the given value is not nil.
|
||||
func (_u *ProcessStepUpdateOne) SetNillableIsTorque(v *bool) *ProcessStepUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetIsTorque(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNeedCheck sets the "needCheck" field.
|
||||
func (_u *ProcessStepUpdateOne) SetNeedCheck(v bool) *ProcessStepUpdateOne {
|
||||
_u.mutation.SetNeedCheck(v)
|
||||
@@ -704,9 +673,6 @@ func (_u *ProcessStepUpdateOne) sqlSave(ctx context.Context) (_node *ProcessStep
|
||||
if value, ok := _u.mutation.CollectType(); ok {
|
||||
_spec.SetField(processstep.FieldCollectType, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.IsTorque(); ok {
|
||||
_spec.SetField(processstep.FieldIsTorque, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := _u.mutation.NeedCheck(); ok {
|
||||
_spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value)
|
||||
}
|
||||
|
||||
@@ -1206,40 +1206,36 @@ func init() {
|
||||
processstep.DefaultCollectType = processstepDescCollectType.Default.(string)
|
||||
// processstep.CollectTypeValidator is a validator for the "collectType" field. It is called by the builders before save.
|
||||
processstep.CollectTypeValidator = processstepDescCollectType.Validators[0].(func(string) error)
|
||||
// processstepDescIsTorque is the schema descriptor for isTorque field.
|
||||
processstepDescIsTorque := processstepFields[5].Descriptor()
|
||||
// processstep.DefaultIsTorque holds the default value on creation for the isTorque field.
|
||||
processstep.DefaultIsTorque = processstepDescIsTorque.Default.(bool)
|
||||
// processstepDescNeedCheck is the schema descriptor for needCheck field.
|
||||
processstepDescNeedCheck := processstepFields[6].Descriptor()
|
||||
processstepDescNeedCheck := processstepFields[5].Descriptor()
|
||||
// processstep.DefaultNeedCheck holds the default value on creation for the needCheck field.
|
||||
processstep.DefaultNeedCheck = processstepDescNeedCheck.Default.(bool)
|
||||
// processstepDescNeedOperatorSign is the schema descriptor for needOperatorSign field.
|
||||
processstepDescNeedOperatorSign := processstepFields[7].Descriptor()
|
||||
processstepDescNeedOperatorSign := processstepFields[6].Descriptor()
|
||||
// processstep.DefaultNeedOperatorSign holds the default value on creation for the needOperatorSign field.
|
||||
processstep.DefaultNeedOperatorSign = processstepDescNeedOperatorSign.Default.(bool)
|
||||
// processstepDescNeedInspectorSign is the schema descriptor for needInspectorSign field.
|
||||
processstepDescNeedInspectorSign := processstepFields[8].Descriptor()
|
||||
processstepDescNeedInspectorSign := processstepFields[7].Descriptor()
|
||||
// processstep.DefaultNeedInspectorSign holds the default value on creation for the needInspectorSign field.
|
||||
processstep.DefaultNeedInspectorSign = processstepDescNeedInspectorSign.Default.(bool)
|
||||
// processstepDescNeedAudit is the schema descriptor for needAudit field.
|
||||
processstepDescNeedAudit := processstepFields[9].Descriptor()
|
||||
processstepDescNeedAudit := processstepFields[8].Descriptor()
|
||||
// processstep.DefaultNeedAudit holds the default value on creation for the needAudit field.
|
||||
processstep.DefaultNeedAudit = processstepDescNeedAudit.Default.(bool)
|
||||
// processstepDescAuditRole is the schema descriptor for auditRole field.
|
||||
processstepDescAuditRole := processstepFields[10].Descriptor()
|
||||
processstepDescAuditRole := processstepFields[9].Descriptor()
|
||||
// processstep.DefaultAuditRole holds the default value on creation for the auditRole field.
|
||||
processstep.DefaultAuditRole = processstepDescAuditRole.Default.(string)
|
||||
// processstep.AuditRoleValidator is a validator for the "auditRole" field. It is called by the builders before save.
|
||||
processstep.AuditRoleValidator = processstepDescAuditRole.Validators[0].(func(string) error)
|
||||
// processstepDescRemark is the schema descriptor for remark field.
|
||||
processstepDescRemark := processstepFields[12].Descriptor()
|
||||
processstepDescRemark := processstepFields[11].Descriptor()
|
||||
// processstep.DefaultRemark holds the default value on creation for the remark field.
|
||||
processstep.DefaultRemark = processstepDescRemark.Default.(string)
|
||||
// processstep.RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
|
||||
processstep.RemarkValidator = processstepDescRemark.Validators[0].(func(string) error)
|
||||
// processstepDescCreatedAt is the schema descriptor for createdAt field.
|
||||
processstepDescCreatedAt := processstepFields[13].Descriptor()
|
||||
processstepDescCreatedAt := processstepFields[12].Descriptor()
|
||||
// processstep.DefaultCreatedAt holds the default value on creation for the createdAt field.
|
||||
processstep.DefaultCreatedAt = processstepDescCreatedAt.Default.(func() time.Time)
|
||||
// processstepDescID is the schema descriptor for id field.
|
||||
@@ -1809,11 +1805,11 @@ func init() {
|
||||
// workorder.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
workorder.StatusValidator = workorderDescStatus.Validators[0].(func(string) error)
|
||||
// workorderDescCreatedAt is the schema descriptor for createdAt field.
|
||||
workorderDescCreatedAt := workorderFields[21].Descriptor()
|
||||
workorderDescCreatedAt := workorderFields[22].Descriptor()
|
||||
// workorder.DefaultCreatedAt holds the default value on creation for the createdAt field.
|
||||
workorder.DefaultCreatedAt = workorderDescCreatedAt.Default.(func() time.Time)
|
||||
// workorderDescUpdatedAt is the schema descriptor for updatedAt field.
|
||||
workorderDescUpdatedAt := workorderFields[22].Descriptor()
|
||||
workorderDescUpdatedAt := workorderFields[23].Descriptor()
|
||||
// workorder.DefaultUpdatedAt holds the default value on creation for the updatedAt field.
|
||||
workorder.DefaultUpdatedAt = workorderDescUpdatedAt.Default.(func() time.Time)
|
||||
// workorder.UpdateDefaultUpdatedAt holds the default value on update for the updatedAt field.
|
||||
|
||||
@@ -58,6 +58,8 @@ type WorkOrder struct {
|
||||
Context map[string]interface{} `json:"context,omitempty"`
|
||||
// CompletedAt holds the value of the "completedAt" field.
|
||||
CompletedAt *time.Time `json:"completedAt,omitempty"`
|
||||
// 实际开始
|
||||
ActualStart *time.Time `json:"actualStart,omitempty"`
|
||||
// CreatedAt holds the value of the "createdAt" field.
|
||||
CreatedAt time.Time `json:"createdAt,omitempty"`
|
||||
// UpdatedAt holds the value of the "updatedAt" field.
|
||||
@@ -76,7 +78,7 @@ func (*WorkOrder) scanValues(columns []string) ([]any, error) {
|
||||
values[i] = new(sql.NullInt64)
|
||||
case workorder.FieldWorkOrderNo, workorder.FieldProductCode, workorder.FieldProductName, workorder.FieldContractNo, workorder.FieldOwnershipType, workorder.FieldProjectNo, workorder.FieldProductSerial, workorder.FieldCreatedBy, workorder.FieldStatus:
|
||||
values[i] = new(sql.NullString)
|
||||
case workorder.FieldDueDate, workorder.FieldPlanStart, workorder.FieldPlanEnd, workorder.FieldCompletedAt, workorder.FieldCreatedAt, workorder.FieldUpdatedAt:
|
||||
case workorder.FieldDueDate, workorder.FieldPlanStart, workorder.FieldPlanEnd, workorder.FieldCompletedAt, workorder.FieldActualStart, workorder.FieldCreatedAt, workorder.FieldUpdatedAt:
|
||||
values[i] = new(sql.NullTime)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -227,6 +229,13 @@ func (_m *WorkOrder) assignValues(columns []string, values []any) error {
|
||||
_m.CompletedAt = new(time.Time)
|
||||
*_m.CompletedAt = value.Time
|
||||
}
|
||||
case workorder.FieldActualStart:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field actualStart", values[i])
|
||||
} else if value.Valid {
|
||||
_m.ActualStart = new(time.Time)
|
||||
*_m.ActualStart = value.Time
|
||||
}
|
||||
case workorder.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field createdAt", values[i])
|
||||
@@ -344,6 +353,11 @@ func (_m *WorkOrder) String() string {
|
||||
builder.WriteString(v.Format(time.ANSIC))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
if v := _m.ActualStart; v != nil {
|
||||
builder.WriteString("actualStart=")
|
||||
builder.WriteString(v.Format(time.ANSIC))
|
||||
}
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("createdAt=")
|
||||
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
|
||||
@@ -144,6 +144,11 @@ func CompletedAt(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldEQ(FieldCompletedAt, v))
|
||||
}
|
||||
|
||||
// ActualStart applies equality check predicate on the "actualStart" field. It's identical to ActualStartEQ.
|
||||
func ActualStart(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldEQ(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -1159,6 +1164,56 @@ func CompletedAtNotNil() predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldNotNull(FieldCompletedAt))
|
||||
}
|
||||
|
||||
// ActualStartEQ applies the EQ predicate on the "actualStart" field.
|
||||
func ActualStartEQ(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldEQ(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartNEQ applies the NEQ predicate on the "actualStart" field.
|
||||
func ActualStartNEQ(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldNEQ(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartIn applies the In predicate on the "actualStart" field.
|
||||
func ActualStartIn(vs ...time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldIn(FieldActualStart, vs...))
|
||||
}
|
||||
|
||||
// ActualStartNotIn applies the NotIn predicate on the "actualStart" field.
|
||||
func ActualStartNotIn(vs ...time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldNotIn(FieldActualStart, vs...))
|
||||
}
|
||||
|
||||
// ActualStartGT applies the GT predicate on the "actualStart" field.
|
||||
func ActualStartGT(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldGT(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartGTE applies the GTE predicate on the "actualStart" field.
|
||||
func ActualStartGTE(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldGTE(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartLT applies the LT predicate on the "actualStart" field.
|
||||
func ActualStartLT(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldLT(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartLTE applies the LTE predicate on the "actualStart" field.
|
||||
func ActualStartLTE(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldLTE(FieldActualStart, v))
|
||||
}
|
||||
|
||||
// ActualStartIsNil applies the IsNil predicate on the "actualStart" field.
|
||||
func ActualStartIsNil() predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldIsNull(FieldActualStart))
|
||||
}
|
||||
|
||||
// ActualStartNotNil applies the NotNil predicate on the "actualStart" field.
|
||||
func ActualStartNotNil() predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldNotNull(FieldActualStart))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.WorkOrder {
|
||||
return predicate.WorkOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
@@ -53,6 +53,8 @@ const (
|
||||
FieldContext = "context"
|
||||
// FieldCompletedAt holds the string denoting the completedat field in the database.
|
||||
FieldCompletedAt = "completed_at"
|
||||
// FieldActualStart holds the string denoting the actualstart field in the database.
|
||||
FieldActualStart = "actual_start"
|
||||
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdatedAt holds the string denoting the updatedat field in the database.
|
||||
@@ -84,6 +86,7 @@ var Columns = []string{
|
||||
FieldPlanEnd,
|
||||
FieldContext,
|
||||
FieldCompletedAt,
|
||||
FieldActualStart,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
}
|
||||
@@ -249,6 +252,11 @@ func ByCompletedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCompletedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByActualStart orders the results by the actualStart field.
|
||||
func ByActualStart(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldActualStart, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the createdAt field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -268,6 +268,20 @@ func (_c *WorkOrderCreate) SetNillableCompletedAt(v *time.Time) *WorkOrderCreate
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetActualStart sets the "actualStart" field.
|
||||
func (_c *WorkOrderCreate) SetActualStart(v time.Time) *WorkOrderCreate {
|
||||
_c.mutation.SetActualStart(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableActualStart sets the "actualStart" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableActualStart(v *time.Time) *WorkOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetActualStart(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "createdAt" field.
|
||||
func (_c *WorkOrderCreate) SetCreatedAt(v time.Time) *WorkOrderCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -604,6 +618,10 @@ func (_c *WorkOrderCreate) createSpec() (*WorkOrder, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(workorder.FieldCompletedAt, field.TypeTime, value)
|
||||
_node.CompletedAt = &value
|
||||
}
|
||||
if value, ok := _c.mutation.ActualStart(); ok {
|
||||
_spec.SetField(workorder.FieldActualStart, field.TypeTime, value)
|
||||
_node.ActualStart = &value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(workorder.FieldCreatedAt, field.TypeTime, value)
|
||||
_node.CreatedAt = value
|
||||
|
||||
@@ -371,6 +371,26 @@ func (_u *WorkOrderUpdate) ClearCompletedAt() *WorkOrderUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetActualStart sets the "actualStart" field.
|
||||
func (_u *WorkOrderUpdate) SetActualStart(v time.Time) *WorkOrderUpdate {
|
||||
_u.mutation.SetActualStart(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableActualStart sets the "actualStart" field if the given value is not nil.
|
||||
func (_u *WorkOrderUpdate) SetNillableActualStart(v *time.Time) *WorkOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetActualStart(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearActualStart clears the value of the "actualStart" field.
|
||||
func (_u *WorkOrderUpdate) ClearActualStart() *WorkOrderUpdate {
|
||||
_u.mutation.ClearActualStart()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updatedAt" field.
|
||||
func (_u *WorkOrderUpdate) SetUpdatedAt(v time.Time) *WorkOrderUpdate {
|
||||
_u.mutation.SetUpdatedAt(v)
|
||||
@@ -590,6 +610,12 @@ func (_u *WorkOrderUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.CompletedAtCleared() {
|
||||
_spec.ClearField(workorder.FieldCompletedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.ActualStart(); ok {
|
||||
_spec.SetField(workorder.FieldActualStart, field.TypeTime, value)
|
||||
}
|
||||
if _u.mutation.ActualStartCleared() {
|
||||
_spec.ClearField(workorder.FieldActualStart, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.UpdatedAt(); ok {
|
||||
_spec.SetField(workorder.FieldUpdatedAt, field.TypeTime, value)
|
||||
}
|
||||
@@ -959,6 +985,26 @@ func (_u *WorkOrderUpdateOne) ClearCompletedAt() *WorkOrderUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetActualStart sets the "actualStart" field.
|
||||
func (_u *WorkOrderUpdateOne) SetActualStart(v time.Time) *WorkOrderUpdateOne {
|
||||
_u.mutation.SetActualStart(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableActualStart sets the "actualStart" field if the given value is not nil.
|
||||
func (_u *WorkOrderUpdateOne) SetNillableActualStart(v *time.Time) *WorkOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetActualStart(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearActualStart clears the value of the "actualStart" field.
|
||||
func (_u *WorkOrderUpdateOne) ClearActualStart() *WorkOrderUpdateOne {
|
||||
_u.mutation.ClearActualStart()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updatedAt" field.
|
||||
func (_u *WorkOrderUpdateOne) SetUpdatedAt(v time.Time) *WorkOrderUpdateOne {
|
||||
_u.mutation.SetUpdatedAt(v)
|
||||
@@ -1208,6 +1254,12 @@ func (_u *WorkOrderUpdateOne) sqlSave(ctx context.Context) (_node *WorkOrder, er
|
||||
if _u.mutation.CompletedAtCleared() {
|
||||
_spec.ClearField(workorder.FieldCompletedAt, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.ActualStart(); ok {
|
||||
_spec.SetField(workorder.FieldActualStart, field.TypeTime, value)
|
||||
}
|
||||
if _u.mutation.ActualStartCleared() {
|
||||
_spec.ClearField(workorder.FieldActualStart, field.TypeTime)
|
||||
}
|
||||
if value, ok := _u.mutation.UpdatedAt(); ok {
|
||||
_spec.SetField(workorder.FieldUpdatedAt, field.TypeTime, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user