feat: 完成区域管理、装箱功能优化与接口标准化
- 新增区域状态字段与增删改查接口,支持区域启用/停用 - 重构实体字段JSON标签为camelCase格式统一接口规范 - 优化入库、盘点、装箱流程的交互与提示文案 - 新增装箱管理功能,支持合同号关联与装箱编辑 - 调整前端菜单与帮助文档适配业务场景变更
This commit is contained in:
@@ -47,6 +47,20 @@ func (_c *ZoneCreate) SetNillableDescription(v *string) *ZoneCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (_c *ZoneCreate) SetStatus(v string) *ZoneCreate {
|
||||
_c.mutation.SetStatus(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableStatus sets the "status" field if the given value is not nil.
|
||||
func (_c *ZoneCreate) SetNillableStatus(v *string) *ZoneCreate {
|
||||
if v != nil {
|
||||
_c.SetStatus(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *ZoneCreate) SetCreatedAt(v int64) *ZoneCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -61,6 +75,20 @@ func (_c *ZoneCreate) SetNillableCreatedAt(v *int64) *ZoneCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (_c *ZoneCreate) SetUpdatedAt(v int64) *ZoneCreate {
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
|
||||
func (_c *ZoneCreate) SetNillableUpdatedAt(v *int64) *ZoneCreate {
|
||||
if v != nil {
|
||||
_c.SetUpdatedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// Mutation returns the ZoneMutation object of the builder.
|
||||
func (_c *ZoneCreate) Mutation() *ZoneMutation {
|
||||
return _c.mutation
|
||||
@@ -96,10 +124,18 @@ func (_c *ZoneCreate) ExecX(ctx context.Context) {
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (_c *ZoneCreate) defaults() {
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
v := zone.DefaultStatus
|
||||
_c.mutation.SetStatus(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := zone.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
}
|
||||
if _, ok := _c.mutation.UpdatedAt(); !ok {
|
||||
v := zone.DefaultUpdatedAt()
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
@@ -110,6 +146,9 @@ func (_c *ZoneCreate) check() error {
|
||||
if _, ok := _c.mutation.ZoneName(); !ok {
|
||||
return &ValidationError{Name: "zone_name", err: errors.New(`ent: missing required field "Zone.zone_name"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "Zone.status"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Zone.created_at"`)}
|
||||
}
|
||||
@@ -152,10 +191,18 @@ func (_c *ZoneCreate) createSpec() (*Zone, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(zone.FieldDescription, field.TypeString, value)
|
||||
_node.Description = value
|
||||
}
|
||||
if value, ok := _c.mutation.Status(); ok {
|
||||
_spec.SetField(zone.FieldStatus, field.TypeString, value)
|
||||
_node.Status = value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(zone.FieldCreatedAt, field.TypeInt64, value)
|
||||
_node.CreatedAt = value
|
||||
}
|
||||
if value, ok := _c.mutation.UpdatedAt(); ok {
|
||||
_spec.SetField(zone.FieldUpdatedAt, field.TypeInt64, value)
|
||||
_node.UpdatedAt = value
|
||||
}
|
||||
return _node, _spec
|
||||
}
|
||||
|
||||
@@ -250,6 +297,18 @@ func (u *ZoneUpsert) ClearDescription() *ZoneUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (u *ZoneUpsert) SetStatus(v string) *ZoneUpsert {
|
||||
u.Set(zone.FieldStatus, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateStatus sets the "status" field to the value that was provided on create.
|
||||
func (u *ZoneUpsert) UpdateStatus() *ZoneUpsert {
|
||||
u.SetExcluded(zone.FieldStatus)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *ZoneUpsert) SetCreatedAt(v int64) *ZoneUpsert {
|
||||
u.Set(zone.FieldCreatedAt, v)
|
||||
@@ -268,6 +327,30 @@ func (u *ZoneUpsert) AddCreatedAt(v int64) *ZoneUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *ZoneUpsert) SetUpdatedAt(v int64) *ZoneUpsert {
|
||||
u.Set(zone.FieldUpdatedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *ZoneUpsert) UpdateUpdatedAt() *ZoneUpsert {
|
||||
u.SetExcluded(zone.FieldUpdatedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *ZoneUpsert) AddUpdatedAt(v int64) *ZoneUpsert {
|
||||
u.Add(zone.FieldUpdatedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *ZoneUpsert) ClearUpdatedAt() *ZoneUpsert {
|
||||
u.SetNull(zone.FieldUpdatedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateNewValues updates the mutable fields using the new values that were set on create.
|
||||
// Using this option is equivalent to using:
|
||||
//
|
||||
@@ -357,6 +440,20 @@ func (u *ZoneUpsertOne) ClearDescription() *ZoneUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (u *ZoneUpsertOne) SetStatus(v string) *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.SetStatus(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateStatus sets the "status" field to the value that was provided on create.
|
||||
func (u *ZoneUpsertOne) UpdateStatus() *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.UpdateStatus()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *ZoneUpsertOne) SetCreatedAt(v int64) *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
@@ -378,6 +475,34 @@ func (u *ZoneUpsertOne) UpdateCreatedAt() *ZoneUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *ZoneUpsertOne) SetUpdatedAt(v int64) *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.SetUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *ZoneUpsertOne) AddUpdatedAt(v int64) *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.AddUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *ZoneUpsertOne) UpdateUpdatedAt() *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.UpdateUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *ZoneUpsertOne) ClearUpdatedAt() *ZoneUpsertOne {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.ClearUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *ZoneUpsertOne) Exec(ctx context.Context) error {
|
||||
if len(u.create.conflict) == 0 {
|
||||
@@ -631,6 +756,20 @@ func (u *ZoneUpsertBulk) ClearDescription() *ZoneUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (u *ZoneUpsertBulk) SetStatus(v string) *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.SetStatus(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateStatus sets the "status" field to the value that was provided on create.
|
||||
func (u *ZoneUpsertBulk) UpdateStatus() *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.UpdateStatus()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *ZoneUpsertBulk) SetCreatedAt(v int64) *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
@@ -652,6 +791,34 @@ func (u *ZoneUpsertBulk) UpdateCreatedAt() *ZoneUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *ZoneUpsertBulk) SetUpdatedAt(v int64) *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.SetUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *ZoneUpsertBulk) AddUpdatedAt(v int64) *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.AddUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *ZoneUpsertBulk) UpdateUpdatedAt() *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.UpdateUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *ZoneUpsertBulk) ClearUpdatedAt() *ZoneUpsertBulk {
|
||||
return u.Update(func(s *ZoneUpsert) {
|
||||
s.ClearUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *ZoneUpsertBulk) Exec(ctx context.Context) error {
|
||||
if u.create.err != nil {
|
||||
|
||||
Reference in New Issue
Block a user