feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package productprocessitem
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the productprocessitem type in the database.
|
||||
Label = "product_process_item"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldProductProcessId holds the string denoting the productprocessid field in the database.
|
||||
FieldProductProcessId = "product_process_id"
|
||||
// FieldSeq holds the string denoting the seq field in the database.
|
||||
FieldSeq = "seq"
|
||||
// FieldFlowId holds the string denoting the flowid field in the database.
|
||||
FieldFlowId = "flow_id"
|
||||
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// Table holds the table name of the productprocessitem in the database.
|
||||
Table = "product_process_item"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for productprocessitem fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldProductProcessId,
|
||||
FieldSeq,
|
||||
FieldFlowId,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||||
IDValidator func(int) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the ProductProcessItem queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByProductProcessId orders the results by the productProcessId field.
|
||||
func ByProductProcessId(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProductProcessId, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySeq orders the results by the seq field.
|
||||
func BySeq(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSeq, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByFlowId orders the results by the flowId field.
|
||||
func ByFlowId(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldFlowId, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the createdAt field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package productprocessitem
|
||||
|
||||
import (
|
||||
"bj_power_mes/ent/predicate"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// ProductProcessId applies equality check predicate on the "productProcessId" field. It's identical to ProductProcessIdEQ.
|
||||
func ProductProcessId(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// Seq applies equality check predicate on the "seq" field. It's identical to SeqEQ.
|
||||
func Seq(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldSeq, v))
|
||||
}
|
||||
|
||||
// FlowId applies equality check predicate on the "flowId" field. It's identical to FlowIdEQ.
|
||||
func FlowId(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdEQ applies the EQ predicate on the "productProcessId" field.
|
||||
func ProductProcessIdEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdNEQ applies the NEQ predicate on the "productProcessId" field.
|
||||
func ProductProcessIdNEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNEQ(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdIn applies the In predicate on the "productProcessId" field.
|
||||
func ProductProcessIdIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldIn(FieldProductProcessId, vs...))
|
||||
}
|
||||
|
||||
// ProductProcessIdNotIn applies the NotIn predicate on the "productProcessId" field.
|
||||
func ProductProcessIdNotIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNotIn(FieldProductProcessId, vs...))
|
||||
}
|
||||
|
||||
// ProductProcessIdGT applies the GT predicate on the "productProcessId" field.
|
||||
func ProductProcessIdGT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGT(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdGTE applies the GTE predicate on the "productProcessId" field.
|
||||
func ProductProcessIdGTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGTE(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdLT applies the LT predicate on the "productProcessId" field.
|
||||
func ProductProcessIdLT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLT(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// ProductProcessIdLTE applies the LTE predicate on the "productProcessId" field.
|
||||
func ProductProcessIdLTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLTE(FieldProductProcessId, v))
|
||||
}
|
||||
|
||||
// SeqEQ applies the EQ predicate on the "seq" field.
|
||||
func SeqEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldSeq, v))
|
||||
}
|
||||
|
||||
// SeqNEQ applies the NEQ predicate on the "seq" field.
|
||||
func SeqNEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNEQ(FieldSeq, v))
|
||||
}
|
||||
|
||||
// SeqIn applies the In predicate on the "seq" field.
|
||||
func SeqIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldIn(FieldSeq, vs...))
|
||||
}
|
||||
|
||||
// SeqNotIn applies the NotIn predicate on the "seq" field.
|
||||
func SeqNotIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNotIn(FieldSeq, vs...))
|
||||
}
|
||||
|
||||
// SeqGT applies the GT predicate on the "seq" field.
|
||||
func SeqGT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGT(FieldSeq, v))
|
||||
}
|
||||
|
||||
// SeqGTE applies the GTE predicate on the "seq" field.
|
||||
func SeqGTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGTE(FieldSeq, v))
|
||||
}
|
||||
|
||||
// SeqLT applies the LT predicate on the "seq" field.
|
||||
func SeqLT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLT(FieldSeq, v))
|
||||
}
|
||||
|
||||
// SeqLTE applies the LTE predicate on the "seq" field.
|
||||
func SeqLTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLTE(FieldSeq, v))
|
||||
}
|
||||
|
||||
// FlowIdEQ applies the EQ predicate on the "flowId" field.
|
||||
func FlowIdEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// FlowIdNEQ applies the NEQ predicate on the "flowId" field.
|
||||
func FlowIdNEQ(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNEQ(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// FlowIdIn applies the In predicate on the "flowId" field.
|
||||
func FlowIdIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldIn(FieldFlowId, vs...))
|
||||
}
|
||||
|
||||
// FlowIdNotIn applies the NotIn predicate on the "flowId" field.
|
||||
func FlowIdNotIn(vs ...int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNotIn(FieldFlowId, vs...))
|
||||
}
|
||||
|
||||
// FlowIdGT applies the GT predicate on the "flowId" field.
|
||||
func FlowIdGT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGT(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// FlowIdGTE applies the GTE predicate on the "flowId" field.
|
||||
func FlowIdGTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGTE(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// FlowIdLT applies the LT predicate on the "flowId" field.
|
||||
func FlowIdLT(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLT(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// FlowIdLTE applies the LTE predicate on the "flowId" field.
|
||||
func FlowIdLTE(v int) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLTE(FieldFlowId, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "createdAt" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "createdAt" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "createdAt" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "createdAt" field.
|
||||
func CreatedAtGT(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "createdAt" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "createdAt" field.
|
||||
func CreatedAtLT(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "createdAt" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.ProductProcessItem) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.ProductProcessItem) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.ProductProcessItem) predicate.ProductProcessItem {
|
||||
return predicate.ProductProcessItem(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user