feat: 完成区域管理、装箱功能优化与接口标准化
- 新增区域状态字段与增删改查接口,支持区域启用/停用 - 重构实体字段JSON标签为camelCase格式统一接口规范 - 优化入库、盘点、装箱流程的交互与提示文案 - 新增装箱管理功能,支持合同号关联与装箱编辑 - 调整前端菜单与帮助文档适配业务场景变更
This commit is contained in:
@@ -83,6 +83,20 @@ func (_c *PackageBoxCreate) SetNillableOperator(v *string) *PackageBoxCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetContractNo sets the "contract_no" field.
|
||||
func (_c *PackageBoxCreate) SetContractNo(v string) *PackageBoxCreate {
|
||||
_c.mutation.SetContractNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableContractNo sets the "contract_no" field if the given value is not nil.
|
||||
func (_c *PackageBoxCreate) SetNillableContractNo(v *string) *PackageBoxCreate {
|
||||
if v != nil {
|
||||
_c.SetContractNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (_c *PackageBoxCreate) SetRemark(v string) *PackageBoxCreate {
|
||||
_c.mutation.SetRemark(v)
|
||||
@@ -111,6 +125,20 @@ func (_c *PackageBoxCreate) SetNillableCreatedAt(v *int64) *PackageBoxCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (_c *PackageBoxCreate) SetUpdatedAt(v int64) *PackageBoxCreate {
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
|
||||
func (_c *PackageBoxCreate) SetNillableUpdatedAt(v *int64) *PackageBoxCreate {
|
||||
if v != nil {
|
||||
_c.SetUpdatedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// Mutation returns the PackageBoxMutation object of the builder.
|
||||
func (_c *PackageBoxCreate) Mutation() *PackageBoxMutation {
|
||||
return _c.mutation
|
||||
@@ -154,6 +182,10 @@ func (_c *PackageBoxCreate) defaults() {
|
||||
v := packagebox.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
}
|
||||
if _, ok := _c.mutation.UpdatedAt(); !ok {
|
||||
v := packagebox.DefaultUpdatedAt()
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
@@ -214,6 +246,10 @@ func (_c *PackageBoxCreate) createSpec() (*PackageBox, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(packagebox.FieldOperator, field.TypeString, value)
|
||||
_node.Operator = value
|
||||
}
|
||||
if value, ok := _c.mutation.ContractNo(); ok {
|
||||
_spec.SetField(packagebox.FieldContractNo, field.TypeString, value)
|
||||
_node.ContractNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.Remark(); ok {
|
||||
_spec.SetField(packagebox.FieldRemark, field.TypeString, value)
|
||||
_node.Remark = value
|
||||
@@ -222,6 +258,10 @@ func (_c *PackageBoxCreate) createSpec() (*PackageBox, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(packagebox.FieldCreatedAt, field.TypeInt64, value)
|
||||
_node.CreatedAt = value
|
||||
}
|
||||
if value, ok := _c.mutation.UpdatedAt(); ok {
|
||||
_spec.SetField(packagebox.FieldUpdatedAt, field.TypeInt64, value)
|
||||
_node.UpdatedAt = value
|
||||
}
|
||||
return _node, _spec
|
||||
}
|
||||
|
||||
@@ -358,6 +398,24 @@ func (u *PackageBoxUpsert) ClearOperator() *PackageBoxUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetContractNo sets the "contract_no" field.
|
||||
func (u *PackageBoxUpsert) SetContractNo(v string) *PackageBoxUpsert {
|
||||
u.Set(packagebox.FieldContractNo, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateContractNo sets the "contract_no" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsert) UpdateContractNo() *PackageBoxUpsert {
|
||||
u.SetExcluded(packagebox.FieldContractNo)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearContractNo clears the value of the "contract_no" field.
|
||||
func (u *PackageBoxUpsert) ClearContractNo() *PackageBoxUpsert {
|
||||
u.SetNull(packagebox.FieldContractNo)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *PackageBoxUpsert) SetRemark(v string) *PackageBoxUpsert {
|
||||
u.Set(packagebox.FieldRemark, v)
|
||||
@@ -394,6 +452,30 @@ func (u *PackageBoxUpsert) AddCreatedAt(v int64) *PackageBoxUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *PackageBoxUpsert) SetUpdatedAt(v int64) *PackageBoxUpsert {
|
||||
u.Set(packagebox.FieldUpdatedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsert) UpdateUpdatedAt() *PackageBoxUpsert {
|
||||
u.SetExcluded(packagebox.FieldUpdatedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *PackageBoxUpsert) AddUpdatedAt(v int64) *PackageBoxUpsert {
|
||||
u.Add(packagebox.FieldUpdatedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *PackageBoxUpsert) ClearUpdatedAt() *PackageBoxUpsert {
|
||||
u.SetNull(packagebox.FieldUpdatedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateNewValues updates the mutable fields using the new values that were set on create.
|
||||
// Using this option is equivalent to using:
|
||||
//
|
||||
@@ -532,6 +614,27 @@ func (u *PackageBoxUpsertOne) ClearOperator() *PackageBoxUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetContractNo sets the "contract_no" field.
|
||||
func (u *PackageBoxUpsertOne) SetContractNo(v string) *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.SetContractNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateContractNo sets the "contract_no" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsertOne) UpdateContractNo() *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.UpdateContractNo()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearContractNo clears the value of the "contract_no" field.
|
||||
func (u *PackageBoxUpsertOne) ClearContractNo() *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.ClearContractNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *PackageBoxUpsertOne) SetRemark(v string) *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
@@ -574,6 +677,34 @@ func (u *PackageBoxUpsertOne) UpdateCreatedAt() *PackageBoxUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *PackageBoxUpsertOne) SetUpdatedAt(v int64) *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.SetUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *PackageBoxUpsertOne) AddUpdatedAt(v int64) *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.AddUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsertOne) UpdateUpdatedAt() *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.UpdateUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *PackageBoxUpsertOne) ClearUpdatedAt() *PackageBoxUpsertOne {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.ClearUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *PackageBoxUpsertOne) Exec(ctx context.Context) error {
|
||||
if len(u.create.conflict) == 0 {
|
||||
@@ -876,6 +1007,27 @@ func (u *PackageBoxUpsertBulk) ClearOperator() *PackageBoxUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetContractNo sets the "contract_no" field.
|
||||
func (u *PackageBoxUpsertBulk) SetContractNo(v string) *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.SetContractNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateContractNo sets the "contract_no" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsertBulk) UpdateContractNo() *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.UpdateContractNo()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearContractNo clears the value of the "contract_no" field.
|
||||
func (u *PackageBoxUpsertBulk) ClearContractNo() *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.ClearContractNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *PackageBoxUpsertBulk) SetRemark(v string) *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
@@ -918,6 +1070,34 @@ func (u *PackageBoxUpsertBulk) UpdateCreatedAt() *PackageBoxUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updated_at" field.
|
||||
func (u *PackageBoxUpsertBulk) SetUpdatedAt(v int64) *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.SetUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddUpdatedAt adds v to the "updated_at" field.
|
||||
func (u *PackageBoxUpsertBulk) AddUpdatedAt(v int64) *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.AddUpdatedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
||||
func (u *PackageBoxUpsertBulk) UpdateUpdatedAt() *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.UpdateUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearUpdatedAt clears the value of the "updated_at" field.
|
||||
func (u *PackageBoxUpsertBulk) ClearUpdatedAt() *PackageBoxUpsertBulk {
|
||||
return u.Update(func(s *PackageBoxUpsert) {
|
||||
s.ClearUpdatedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (u *PackageBoxUpsertBulk) Exec(ctx context.Context) error {
|
||||
if u.create.err != nil {
|
||||
|
||||
Reference in New Issue
Block a user