chore: 批量完成项目多模块迭代优化
1. 废弃半成品库存表并统一库存主表 2. 修复列表排序与搜索大小写不敏感问题 3. 新增用户最近登录时间、工单BOM名称字段 4. 完善角色管理、工位选择器功能 5. 增加拧紧数据补录、成品自动回流WMS能力 6. 统一导出时间范围校验规则 7. 丰富物料/备料单筛选条件 8. 调整菜单与权限命名适配产品型号业务
This commit is contained in:
@@ -48,6 +48,27 @@ func (_u *InventoryUpdate) AddManageMode(v int) *InventoryUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (_u *InventoryUpdate) SetCategory(v int) *InventoryUpdate {
|
||||
_u.mutation.ResetCategory()
|
||||
_u.mutation.SetCategory(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCategory sets the "category" field if the given value is not nil.
|
||||
func (_u *InventoryUpdate) SetNillableCategory(v *int) *InventoryUpdate {
|
||||
if v != nil {
|
||||
_u.SetCategory(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddCategory adds value to the "category" field.
|
||||
func (_u *InventoryUpdate) AddCategory(v int) *InventoryUpdate {
|
||||
_u.mutation.AddCategory(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (_u *InventoryUpdate) SetMaterialCode(v string) *InventoryUpdate {
|
||||
_u.mutation.SetMaterialCode(v)
|
||||
@@ -272,6 +293,34 @@ func (_u *InventoryUpdate) ClearInboundNo() *InventoryUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (_u *InventoryUpdate) SetOrderNo(v string) *InventoryUpdate {
|
||||
_u.mutation.SetOrderNo(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableOrderNo sets the "order_no" field if the given value is not nil.
|
||||
func (_u *InventoryUpdate) SetNillableOrderNo(v *string) *InventoryUpdate {
|
||||
if v != nil {
|
||||
_u.SetOrderNo(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (_u *InventoryUpdate) SetCompletedProcess(v string) *InventoryUpdate {
|
||||
_u.mutation.SetCompletedProcess(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCompletedProcess sets the "completed_process" field if the given value is not nil.
|
||||
func (_u *InventoryUpdate) SetNillableCompletedProcess(v *string) *InventoryUpdate {
|
||||
if v != nil {
|
||||
_u.SetCompletedProcess(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (_u *InventoryUpdate) SetRemark(v string) *InventoryUpdate {
|
||||
_u.mutation.SetRemark(v)
|
||||
@@ -366,7 +415,25 @@ func (_u *InventoryUpdate) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (_u *InventoryUpdate) check() error {
|
||||
if v, ok := _u.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 v, ok := _u.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)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_u *InventoryUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if err := _u.check(); err != nil {
|
||||
return _node, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(inventory.Table, inventory.Columns, sqlgraph.NewFieldSpec(inventory.FieldID, field.TypeInt))
|
||||
if ps := _u.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
@@ -381,6 +448,12 @@ func (_u *InventoryUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if value, ok := _u.mutation.AddedManageMode(); ok {
|
||||
_spec.AddField(inventory.FieldManageMode, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Category(); ok {
|
||||
_spec.SetField(inventory.FieldCategory, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedCategory(); ok {
|
||||
_spec.AddField(inventory.FieldCategory, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.MaterialCode(); ok {
|
||||
_spec.SetField(inventory.FieldMaterialCode, field.TypeString, value)
|
||||
}
|
||||
@@ -444,6 +517,12 @@ func (_u *InventoryUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
if _u.mutation.InboundNoCleared() {
|
||||
_spec.ClearField(inventory.FieldInboundNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.OrderNo(); ok {
|
||||
_spec.SetField(inventory.FieldOrderNo, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.CompletedProcess(); ok {
|
||||
_spec.SetField(inventory.FieldCompletedProcess, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Remark(); ok {
|
||||
_spec.SetField(inventory.FieldRemark, field.TypeString, value)
|
||||
}
|
||||
@@ -503,6 +582,27 @@ func (_u *InventoryUpdateOne) AddManageMode(v int) *InventoryUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCategory sets the "category" field.
|
||||
func (_u *InventoryUpdateOne) SetCategory(v int) *InventoryUpdateOne {
|
||||
_u.mutation.ResetCategory()
|
||||
_u.mutation.SetCategory(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCategory sets the "category" field if the given value is not nil.
|
||||
func (_u *InventoryUpdateOne) SetNillableCategory(v *int) *InventoryUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetCategory(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// AddCategory adds value to the "category" field.
|
||||
func (_u *InventoryUpdateOne) AddCategory(v int) *InventoryUpdateOne {
|
||||
_u.mutation.AddCategory(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetMaterialCode sets the "material_code" field.
|
||||
func (_u *InventoryUpdateOne) SetMaterialCode(v string) *InventoryUpdateOne {
|
||||
_u.mutation.SetMaterialCode(v)
|
||||
@@ -727,6 +827,34 @@ func (_u *InventoryUpdateOne) ClearInboundNo() *InventoryUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetOrderNo sets the "order_no" field.
|
||||
func (_u *InventoryUpdateOne) SetOrderNo(v string) *InventoryUpdateOne {
|
||||
_u.mutation.SetOrderNo(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableOrderNo sets the "order_no" field if the given value is not nil.
|
||||
func (_u *InventoryUpdateOne) SetNillableOrderNo(v *string) *InventoryUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetOrderNo(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCompletedProcess sets the "completed_process" field.
|
||||
func (_u *InventoryUpdateOne) SetCompletedProcess(v string) *InventoryUpdateOne {
|
||||
_u.mutation.SetCompletedProcess(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableCompletedProcess sets the "completed_process" field if the given value is not nil.
|
||||
func (_u *InventoryUpdateOne) SetNillableCompletedProcess(v *string) *InventoryUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetCompletedProcess(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetRemark sets the "remark" field.
|
||||
func (_u *InventoryUpdateOne) SetRemark(v string) *InventoryUpdateOne {
|
||||
_u.mutation.SetRemark(v)
|
||||
@@ -834,7 +962,25 @@ func (_u *InventoryUpdateOne) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (_u *InventoryUpdateOne) check() error {
|
||||
if v, ok := _u.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 v, ok := _u.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)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_u *InventoryUpdateOne) sqlSave(ctx context.Context) (_node *Inventory, err error) {
|
||||
if err := _u.check(); err != nil {
|
||||
return _node, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(inventory.Table, inventory.Columns, sqlgraph.NewFieldSpec(inventory.FieldID, field.TypeInt))
|
||||
id, ok := _u.mutation.ID()
|
||||
if !ok {
|
||||
@@ -866,6 +1012,12 @@ func (_u *InventoryUpdateOne) sqlSave(ctx context.Context) (_node *Inventory, er
|
||||
if value, ok := _u.mutation.AddedManageMode(); ok {
|
||||
_spec.AddField(inventory.FieldManageMode, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Category(); ok {
|
||||
_spec.SetField(inventory.FieldCategory, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AddedCategory(); ok {
|
||||
_spec.AddField(inventory.FieldCategory, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := _u.mutation.MaterialCode(); ok {
|
||||
_spec.SetField(inventory.FieldMaterialCode, field.TypeString, value)
|
||||
}
|
||||
@@ -929,6 +1081,12 @@ func (_u *InventoryUpdateOne) sqlSave(ctx context.Context) (_node *Inventory, er
|
||||
if _u.mutation.InboundNoCleared() {
|
||||
_spec.ClearField(inventory.FieldInboundNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.OrderNo(); ok {
|
||||
_spec.SetField(inventory.FieldOrderNo, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.CompletedProcess(); ok {
|
||||
_spec.SetField(inventory.FieldCompletedProcess, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Remark(); ok {
|
||||
_spec.SetField(inventory.FieldRemark, field.TypeString, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user