chore: 批量完成项目多模块迭代优化

1. 废弃半成品库存表并统一库存主表
2. 修复列表排序与搜索大小写不敏感问题
3. 新增用户最近登录时间、工单BOM名称字段
4. 完善角色管理、工位选择器功能
5. 增加拧紧数据补录、成品自动回流WMS能力
6. 统一导出时间范围校验规则
7. 丰富物料/备料单筛选条件
8. 调整菜单与权限命名适配产品型号业务
This commit is contained in:
SunYF
2026-09-08 11:44:04 +08:00
parent 06689970e2
commit e852c7cd37
96 changed files with 4528 additions and 542 deletions
+30
View File
@@ -46,6 +46,20 @@ func (_c *WorkOrderCreate) SetNillableProductCode(v *string) *WorkOrderCreate {
return _c
}
// SetBomName sets the "bomName" field.
func (_c *WorkOrderCreate) SetBomName(v string) *WorkOrderCreate {
_c.mutation.SetBomName(v)
return _c
}
// SetNillableBomName sets the "bomName" field if the given value is not nil.
func (_c *WorkOrderCreate) SetNillableBomName(v *string) *WorkOrderCreate {
if v != nil {
_c.SetBomName(*v)
}
return _c
}
// SetProductName sets the "productName" field.
func (_c *WorkOrderCreate) SetProductName(v string) *WorkOrderCreate {
_c.mutation.SetProductName(v)
@@ -251,6 +265,10 @@ func (_c *WorkOrderCreate) defaults() {
v := workorder.DefaultProductCode
_c.mutation.SetProductCode(v)
}
if _, ok := _c.mutation.BomName(); !ok {
v := workorder.DefaultBomName
_c.mutation.SetBomName(v)
}
if _, ok := _c.mutation.ProductName(); !ok {
v := workorder.DefaultProductName
_c.mutation.SetProductName(v)
@@ -306,6 +324,14 @@ func (_c *WorkOrderCreate) check() error {
return &ValidationError{Name: "productCode", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.productCode": %w`, err)}
}
}
if _, ok := _c.mutation.BomName(); !ok {
return &ValidationError{Name: "bomName", err: errors.New(`ent: missing required field "WorkOrder.bomName"`)}
}
if v, ok := _c.mutation.BomName(); ok {
if err := workorder.BomNameValidator(v); err != nil {
return &ValidationError{Name: "bomName", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.bomName": %w`, err)}
}
}
if _, ok := _c.mutation.ProductName(); !ok {
return &ValidationError{Name: "productName", err: errors.New(`ent: missing required field "WorkOrder.productName"`)}
}
@@ -391,6 +417,10 @@ func (_c *WorkOrderCreate) createSpec() (*WorkOrder, *sqlgraph.CreateSpec) {
_spec.SetField(workorder.FieldProductCode, field.TypeString, value)
_node.ProductCode = value
}
if value, ok := _c.mutation.BomName(); ok {
_spec.SetField(workorder.FieldBomName, field.TypeString, value)
_node.BomName = value
}
if value, ok := _c.mutation.ProductName(); ok {
_spec.SetField(workorder.FieldProductName, field.TypeString, value)
_node.ProductName = value