feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -29,6 +29,10 @@ const (
|
||||
FieldNeedOperatorSign = "need_operator_sign"
|
||||
// FieldNeedInspectorSign holds the string denoting the needinspectorsign field in the database.
|
||||
FieldNeedInspectorSign = "need_inspector_sign"
|
||||
// FieldNeedAudit holds the string denoting the needaudit field in the database.
|
||||
FieldNeedAudit = "need_audit"
|
||||
// FieldAuditRole holds the string denoting the auditrole field in the database.
|
||||
FieldAuditRole = "audit_role"
|
||||
// FieldAttachment holds the string denoting the attachment field in the database.
|
||||
FieldAttachment = "attachment"
|
||||
// FieldRemark holds the string denoting the remark field in the database.
|
||||
@@ -50,6 +54,8 @@ var Columns = []string{
|
||||
FieldNeedCheck,
|
||||
FieldNeedOperatorSign,
|
||||
FieldNeedInspectorSign,
|
||||
FieldNeedAudit,
|
||||
FieldAuditRole,
|
||||
FieldAttachment,
|
||||
FieldRemark,
|
||||
FieldCreatedAt,
|
||||
@@ -82,6 +88,12 @@ var (
|
||||
DefaultNeedOperatorSign bool
|
||||
// DefaultNeedInspectorSign holds the default value on creation for the "needInspectorSign" field.
|
||||
DefaultNeedInspectorSign bool
|
||||
// DefaultNeedAudit holds the default value on creation for the "needAudit" field.
|
||||
DefaultNeedAudit bool
|
||||
// DefaultAuditRole holds the default value on creation for the "auditRole" field.
|
||||
DefaultAuditRole string
|
||||
// AuditRoleValidator is a validator for the "auditRole" field. It is called by the builders before save.
|
||||
AuditRoleValidator func(string) error
|
||||
// DefaultRemark holds the default value on creation for the "remark" field.
|
||||
DefaultRemark string
|
||||
// RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
|
||||
@@ -140,6 +152,16 @@ func ByNeedInspectorSign(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNeedInspectorSign, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNeedAudit orders the results by the needAudit field.
|
||||
func ByNeedAudit(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNeedAudit, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAuditRole orders the results by the auditRole field.
|
||||
func ByAuditRole(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAuditRole, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRemark orders the results by the remark field.
|
||||
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRemark, opts...).ToFunc()
|
||||
|
||||
@@ -94,6 +94,16 @@ func NeedInspectorSign(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldNeedInspectorSign, v))
|
||||
}
|
||||
|
||||
// NeedAudit applies equality check predicate on the "needAudit" field. It's identical to NeedAuditEQ.
|
||||
func NeedAudit(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldNeedAudit, v))
|
||||
}
|
||||
|
||||
// AuditRole applies equality check predicate on the "auditRole" field. It's identical to AuditRoleEQ.
|
||||
func AuditRole(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ.
|
||||
func Remark(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldRemark, v))
|
||||
@@ -364,6 +374,91 @@ func NeedInspectorSignNEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNEQ(FieldNeedInspectorSign, v))
|
||||
}
|
||||
|
||||
// NeedAuditEQ applies the EQ predicate on the "needAudit" field.
|
||||
func NeedAuditEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldNeedAudit, v))
|
||||
}
|
||||
|
||||
// NeedAuditNEQ applies the NEQ predicate on the "needAudit" field.
|
||||
func NeedAuditNEQ(v bool) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNEQ(FieldNeedAudit, v))
|
||||
}
|
||||
|
||||
// AuditRoleEQ applies the EQ predicate on the "auditRole" field.
|
||||
func AuditRoleEQ(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEQ(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleNEQ applies the NEQ predicate on the "auditRole" field.
|
||||
func AuditRoleNEQ(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNEQ(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleIn applies the In predicate on the "auditRole" field.
|
||||
func AuditRoleIn(vs ...string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldIn(FieldAuditRole, vs...))
|
||||
}
|
||||
|
||||
// AuditRoleNotIn applies the NotIn predicate on the "auditRole" field.
|
||||
func AuditRoleNotIn(vs ...string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNotIn(FieldAuditRole, vs...))
|
||||
}
|
||||
|
||||
// AuditRoleGT applies the GT predicate on the "auditRole" field.
|
||||
func AuditRoleGT(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldGT(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleGTE applies the GTE predicate on the "auditRole" field.
|
||||
func AuditRoleGTE(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldGTE(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleLT applies the LT predicate on the "auditRole" field.
|
||||
func AuditRoleLT(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldLT(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleLTE applies the LTE predicate on the "auditRole" field.
|
||||
func AuditRoleLTE(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldLTE(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleContains applies the Contains predicate on the "auditRole" field.
|
||||
func AuditRoleContains(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldContains(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleHasPrefix applies the HasPrefix predicate on the "auditRole" field.
|
||||
func AuditRoleHasPrefix(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldHasPrefix(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleHasSuffix applies the HasSuffix predicate on the "auditRole" field.
|
||||
func AuditRoleHasSuffix(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldHasSuffix(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleIsNil applies the IsNil predicate on the "auditRole" field.
|
||||
func AuditRoleIsNil() predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldIsNull(FieldAuditRole))
|
||||
}
|
||||
|
||||
// AuditRoleNotNil applies the NotNil predicate on the "auditRole" field.
|
||||
func AuditRoleNotNil() predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldNotNull(FieldAuditRole))
|
||||
}
|
||||
|
||||
// AuditRoleEqualFold applies the EqualFold predicate on the "auditRole" field.
|
||||
func AuditRoleEqualFold(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldEqualFold(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AuditRoleContainsFold applies the ContainsFold predicate on the "auditRole" field.
|
||||
func AuditRoleContainsFold(v string) predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldContainsFold(FieldAuditRole, v))
|
||||
}
|
||||
|
||||
// AttachmentIsNil applies the IsNil predicate on the "attachment" field.
|
||||
func AttachmentIsNil() predicate.ProcessStep {
|
||||
return predicate.ProcessStep(sql.FieldIsNull(FieldAttachment))
|
||||
|
||||
Reference in New Issue
Block a user