feat: 新增产品工艺管理与工序审核功能

- 新增产品工艺(product_process)及明细(product_process_item)数据模型
- 新增工序审核开关(need_audit)与审核角色(audit_role)字段
- 新增待审核签字页面与路由
- 优化 WMS/MES 接口交互,增加业务错误处理与友好提示
- 补充库存过滤逻辑,避免返回已出库 SN 数据
- 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
SunYF
2026-10-09 13:46:33 +08:00
parent e2f1dacf76
commit b032f47fc7
95 changed files with 10546 additions and 1457 deletions
@@ -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()