chore: 批量完成项目多模块迭代优化
1. 废弃半成品库存表并统一库存主表 2. 修复列表排序与搜索大小写不敏感问题 3. 新增用户最近登录时间、工单BOM名称字段 4. 完善角色管理、工位选择器功能 5. 增加拧紧数据补录、成品自动回流WMS能力 6. 统一导出时间范围校验规则 7. 丰富物料/备料单筛选条件 8. 调整菜单与权限命名适配产品型号业务
This commit is contained in:
@@ -27,6 +27,20 @@ func (_c *InventoryCreate) SetManageMode(v int) *InventoryCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (_c *InventoryCreate) SetCategory(v int) *InventoryCreate {
|
||||
_c.mutation.SetCategory(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableCategory sets the "category" field if the given value is not nil.
|
||||
func (_c *InventoryCreate) SetNillableCategory(v *int) *InventoryCreate {
|
||||
if v != nil {
|
||||
_c.SetCategory(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (_c *InventoryCreate) SetMaterialCode(v string) *InventoryCreate {
|
||||
_c.mutation.SetMaterialCode(v)
|
||||
@@ -187,6 +201,34 @@ func (_c *InventoryCreate) SetNillableInboundNo(v *string) *InventoryCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (_c *InventoryCreate) SetOrderNo(v string) *InventoryCreate {
|
||||
_c.mutation.SetOrderNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableOrderNo sets the "order_no" field if the given value is not nil.
|
||||
func (_c *InventoryCreate) SetNillableOrderNo(v *string) *InventoryCreate {
|
||||
if v != nil {
|
||||
_c.SetOrderNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (_c *InventoryCreate) SetCompletedProcess(v string) *InventoryCreate {
|
||||
_c.mutation.SetCompletedProcess(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableCompletedProcess sets the "completed_process" field if the given value is not nil.
|
||||
func (_c *InventoryCreate) SetNillableCompletedProcess(v *string) *InventoryCreate {
|
||||
if v != nil {
|
||||
_c.SetCompletedProcess(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (_c *InventoryCreate) SetRemark(v string) *InventoryCreate {
|
||||
_c.mutation.SetRemark(v)
|
||||
@@ -264,6 +306,10 @@ func (_c *InventoryCreate) ExecX(ctx context.Context) {
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (_c *InventoryCreate) defaults() {
|
||||
if _, ok := _c.mutation.Category(); !ok {
|
||||
v := inventory.DefaultCategory
|
||||
_c.mutation.SetCategory(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Quantity(); !ok {
|
||||
v := inventory.DefaultQuantity
|
||||
_c.mutation.SetQuantity(v)
|
||||
@@ -280,6 +326,14 @@ func (_c *InventoryCreate) defaults() {
|
||||
v := inventory.DefaultStatus
|
||||
_c.mutation.SetStatus(v)
|
||||
}
|
||||
if _, ok := _c.mutation.OrderNo(); !ok {
|
||||
v := inventory.DefaultOrderNo
|
||||
_c.mutation.SetOrderNo(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CompletedProcess(); !ok {
|
||||
v := inventory.DefaultCompletedProcess
|
||||
_c.mutation.SetCompletedProcess(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := inventory.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -295,6 +349,9 @@ func (_c *InventoryCreate) check() error {
|
||||
if _, ok := _c.mutation.ManageMode(); !ok {
|
||||
return &ValidationError{Name: "manage_mode", err: errors.New(`ent: missing required field "Inventory.manage_mode"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.Category(); !ok {
|
||||
return &ValidationError{Name: "category", err: errors.New(`ent: missing required field "Inventory.category"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.MaterialCode(); !ok {
|
||||
return &ValidationError{Name: "material_code", err: errors.New(`ent: missing required field "Inventory.material_code"`)}
|
||||
}
|
||||
@@ -310,6 +367,22 @@ func (_c *InventoryCreate) check() error {
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "Inventory.status"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.OrderNo(); !ok {
|
||||
return &ValidationError{Name: "order_no", err: errors.New(`ent: missing required field "Inventory.order_no"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.OrderNo(); ok {
|
||||
if err := inventory.OrderNoValidator(v); err != nil {
|
||||
return &ValidationError{Name: "order_no", err: fmt.Errorf(`ent: validator failed for field "Inventory.order_no": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.CompletedProcess(); !ok {
|
||||
return &ValidationError{Name: "completed_process", err: errors.New(`ent: missing required field "Inventory.completed_process"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.CompletedProcess(); ok {
|
||||
if err := inventory.CompletedProcessValidator(v); err != nil {
|
||||
return &ValidationError{Name: "completed_process", err: fmt.Errorf(`ent: validator failed for field "Inventory.completed_process": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Inventory.created_at"`)}
|
||||
}
|
||||
@@ -347,6 +420,10 @@ func (_c *InventoryCreate) createSpec() (*Inventory, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(inventory.FieldManageMode, field.TypeInt, value)
|
||||
_node.ManageMode = value
|
||||
}
|
||||
if value, ok := _c.mutation.Category(); ok {
|
||||
_spec.SetField(inventory.FieldCategory, field.TypeInt, value)
|
||||
_node.Category = value
|
||||
}
|
||||
if value, ok := _c.mutation.MaterialCode(); ok {
|
||||
_spec.SetField(inventory.FieldMaterialCode, field.TypeString, value)
|
||||
_node.MaterialCode = value
|
||||
@@ -395,6 +472,14 @@ func (_c *InventoryCreate) createSpec() (*Inventory, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(inventory.FieldInboundNo, field.TypeString, value)
|
||||
_node.InboundNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.OrderNo(); ok {
|
||||
_spec.SetField(inventory.FieldOrderNo, field.TypeString, value)
|
||||
_node.OrderNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.CompletedProcess(); ok {
|
||||
_spec.SetField(inventory.FieldCompletedProcess, field.TypeString, value)
|
||||
_node.CompletedProcess = value
|
||||
}
|
||||
if value, ok := _c.mutation.Remark(); ok {
|
||||
_spec.SetField(inventory.FieldRemark, field.TypeString, value)
|
||||
_node.Remark = value
|
||||
@@ -477,6 +562,24 @@ func (u *InventoryUpsert) AddManageMode(v int) *InventoryUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (u *InventoryUpsert) SetCategory(v int) *InventoryUpsert {
|
||||
u.Set(inventory.FieldCategory, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateCategory sets the "category" field to the value that was provided on create.
|
||||
func (u *InventoryUpsert) UpdateCategory() *InventoryUpsert {
|
||||
u.SetExcluded(inventory.FieldCategory)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddCategory adds v to the "category" field.
|
||||
func (u *InventoryUpsert) AddCategory(v int) *InventoryUpsert {
|
||||
u.Add(inventory.FieldCategory, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (u *InventoryUpsert) SetMaterialCode(v string) *InventoryUpsert {
|
||||
u.Set(inventory.FieldMaterialCode, v)
|
||||
@@ -675,6 +778,30 @@ func (u *InventoryUpsert) ClearInboundNo() *InventoryUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (u *InventoryUpsert) SetOrderNo(v string) *InventoryUpsert {
|
||||
u.Set(inventory.FieldOrderNo, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateOrderNo sets the "order_no" field to the value that was provided on create.
|
||||
func (u *InventoryUpsert) UpdateOrderNo() *InventoryUpsert {
|
||||
u.SetExcluded(inventory.FieldOrderNo)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (u *InventoryUpsert) SetCompletedProcess(v string) *InventoryUpsert {
|
||||
u.Set(inventory.FieldCompletedProcess, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateCompletedProcess sets the "completed_process" field to the value that was provided on create.
|
||||
func (u *InventoryUpsert) UpdateCompletedProcess() *InventoryUpsert {
|
||||
u.SetExcluded(inventory.FieldCompletedProcess)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *InventoryUpsert) SetRemark(v string) *InventoryUpsert {
|
||||
u.Set(inventory.FieldRemark, v)
|
||||
@@ -790,6 +917,27 @@ func (u *InventoryUpsertOne) UpdateManageMode() *InventoryUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (u *InventoryUpsertOne) SetCategory(v int) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetCategory(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddCategory adds v to the "category" field.
|
||||
func (u *InventoryUpsertOne) AddCategory(v int) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.AddCategory(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateCategory sets the "category" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertOne) UpdateCategory() *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateCategory()
|
||||
})
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (u *InventoryUpsertOne) SetMaterialCode(v string) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
@@ -1021,6 +1169,34 @@ func (u *InventoryUpsertOne) ClearInboundNo() *InventoryUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (u *InventoryUpsertOne) SetOrderNo(v string) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetOrderNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateOrderNo sets the "order_no" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertOne) UpdateOrderNo() *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateOrderNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (u *InventoryUpsertOne) SetCompletedProcess(v string) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetCompletedProcess(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateCompletedProcess sets the "completed_process" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertOne) UpdateCompletedProcess() *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateCompletedProcess()
|
||||
})
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *InventoryUpsertOne) SetRemark(v string) *InventoryUpsertOne {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
@@ -1309,6 +1485,27 @@ func (u *InventoryUpsertBulk) UpdateManageMode() *InventoryUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (u *InventoryUpsertBulk) SetCategory(v int) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetCategory(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddCategory adds v to the "category" field.
|
||||
func (u *InventoryUpsertBulk) AddCategory(v int) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.AddCategory(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateCategory sets the "category" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertBulk) UpdateCategory() *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateCategory()
|
||||
})
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (u *InventoryUpsertBulk) SetMaterialCode(v string) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
@@ -1540,6 +1737,34 @@ func (u *InventoryUpsertBulk) ClearInboundNo() *InventoryUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (u *InventoryUpsertBulk) SetOrderNo(v string) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetOrderNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateOrderNo sets the "order_no" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertBulk) UpdateOrderNo() *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateOrderNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (u *InventoryUpsertBulk) SetCompletedProcess(v string) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.SetCompletedProcess(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateCompletedProcess sets the "completed_process" field to the value that was provided on create.
|
||||
func (u *InventoryUpsertBulk) UpdateCompletedProcess() *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
s.UpdateCompletedProcess()
|
||||
})
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (u *InventoryUpsertBulk) SetRemark(v string) *InventoryUpsertBulk {
|
||||
return u.Update(func(s *InventoryUpsert) {
|
||||
|
||||
Reference in New Issue
Block a user