feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -124,6 +124,34 @@ func (_c *ProcessStepCreate) SetNillableNeedInspectorSign(v *bool) *ProcessStepC
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNeedAudit sets the "needAudit" field.
|
||||
func (_c *ProcessStepCreate) SetNeedAudit(v bool) *ProcessStepCreate {
|
||||
_c.mutation.SetNeedAudit(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableNeedAudit sets the "needAudit" field if the given value is not nil.
|
||||
func (_c *ProcessStepCreate) SetNillableNeedAudit(v *bool) *ProcessStepCreate {
|
||||
if v != nil {
|
||||
_c.SetNeedAudit(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetAuditRole sets the "auditRole" field.
|
||||
func (_c *ProcessStepCreate) SetAuditRole(v string) *ProcessStepCreate {
|
||||
_c.mutation.SetAuditRole(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableAuditRole sets the "auditRole" field if the given value is not nil.
|
||||
func (_c *ProcessStepCreate) SetNillableAuditRole(v *string) *ProcessStepCreate {
|
||||
if v != nil {
|
||||
_c.SetAuditRole(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetAttachment sets the "attachment" field.
|
||||
func (_c *ProcessStepCreate) SetAttachment(v []map[string]string) *ProcessStepCreate {
|
||||
_c.mutation.SetAttachment(v)
|
||||
@@ -223,6 +251,14 @@ func (_c *ProcessStepCreate) defaults() {
|
||||
v := processstep.DefaultNeedInspectorSign
|
||||
_c.mutation.SetNeedInspectorSign(v)
|
||||
}
|
||||
if _, ok := _c.mutation.NeedAudit(); !ok {
|
||||
v := processstep.DefaultNeedAudit
|
||||
_c.mutation.SetNeedAudit(v)
|
||||
}
|
||||
if _, ok := _c.mutation.AuditRole(); !ok {
|
||||
v := processstep.DefaultAuditRole
|
||||
_c.mutation.SetAuditRole(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Remark(); !ok {
|
||||
v := processstep.DefaultRemark
|
||||
_c.mutation.SetRemark(v)
|
||||
@@ -266,6 +302,14 @@ func (_c *ProcessStepCreate) check() error {
|
||||
if _, ok := _c.mutation.NeedInspectorSign(); !ok {
|
||||
return &ValidationError{Name: "needInspectorSign", err: errors.New(`ent: missing required field "ProcessStep.needInspectorSign"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.NeedAudit(); !ok {
|
||||
return &ValidationError{Name: "needAudit", err: errors.New(`ent: missing required field "ProcessStep.needAudit"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.AuditRole(); ok {
|
||||
if err := processstep.AuditRoleValidator(v); err != nil {
|
||||
return &ValidationError{Name: "auditRole", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.auditRole": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.Remark(); !ok {
|
||||
return &ValidationError{Name: "remark", err: errors.New(`ent: missing required field "ProcessStep.remark"`)}
|
||||
}
|
||||
@@ -346,6 +390,14 @@ func (_c *ProcessStepCreate) createSpec() (*ProcessStep, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(processstep.FieldNeedInspectorSign, field.TypeBool, value)
|
||||
_node.NeedInspectorSign = value
|
||||
}
|
||||
if value, ok := _c.mutation.NeedAudit(); ok {
|
||||
_spec.SetField(processstep.FieldNeedAudit, field.TypeBool, value)
|
||||
_node.NeedAudit = value
|
||||
}
|
||||
if value, ok := _c.mutation.AuditRole(); ok {
|
||||
_spec.SetField(processstep.FieldAuditRole, field.TypeString, value)
|
||||
_node.AuditRole = value
|
||||
}
|
||||
if value, ok := _c.mutation.Attachment(); ok {
|
||||
_spec.SetField(processstep.FieldAttachment, field.TypeJSON, value)
|
||||
_node.Attachment = value
|
||||
|
||||
Reference in New Issue
Block a user