feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -192,6 +192,20 @@ func (_c *WorkOrderCreate) SetFlowCombination(v []map[string]int) *WorkOrderCrea
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetProductProcessId sets the "productProcessId" field.
|
||||
func (_c *WorkOrderCreate) SetProductProcessId(v int) *WorkOrderCreate {
|
||||
_c.mutation.SetProductProcessId(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableProductProcessId sets the "productProcessId" field if the given value is not nil.
|
||||
func (_c *WorkOrderCreate) SetNillableProductProcessId(v *int) *WorkOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetProductProcessId(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetStatus sets the "status" field.
|
||||
func (_c *WorkOrderCreate) SetStatus(v string) *WorkOrderCreate {
|
||||
_c.mutation.SetStatus(v)
|
||||
@@ -363,6 +377,10 @@ func (_c *WorkOrderCreate) defaults() {
|
||||
v := workorder.DefaultCreatedBy
|
||||
_c.mutation.SetCreatedBy(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ProductProcessId(); !ok {
|
||||
v := workorder.DefaultProductProcessId
|
||||
_c.mutation.SetProductProcessId(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
v := workorder.DefaultStatus
|
||||
_c.mutation.SetStatus(v)
|
||||
@@ -455,6 +473,9 @@ func (_c *WorkOrderCreate) check() error {
|
||||
return &ValidationError{Name: "createdBy", err: fmt.Errorf(`ent: validator failed for field "WorkOrder.createdBy": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ProductProcessId(); !ok {
|
||||
return &ValidationError{Name: "productProcessId", err: errors.New(`ent: missing required field "WorkOrder.productProcessId"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.Status(); !ok {
|
||||
return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "WorkOrder.status"`)}
|
||||
}
|
||||
@@ -559,6 +580,10 @@ func (_c *WorkOrderCreate) createSpec() (*WorkOrder, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(workorder.FieldFlowCombination, field.TypeJSON, value)
|
||||
_node.FlowCombination = value
|
||||
}
|
||||
if value, ok := _c.mutation.ProductProcessId(); ok {
|
||||
_spec.SetField(workorder.FieldProductProcessId, field.TypeInt, value)
|
||||
_node.ProductProcessId = value
|
||||
}
|
||||
if value, ok := _c.mutation.Status(); ok {
|
||||
_spec.SetField(workorder.FieldStatus, field.TypeString, value)
|
||||
_node.Status = value
|
||||
|
||||
Reference in New Issue
Block a user