feat: 新增预警与附件模块,优化工位派工功能

1. 新增预警规则、预警消息、业务附件数据库表与CRUD逻辑
2. 为拧紧记录添加审核人、审核时间字段及审核留痕功能
3. 优化产线点位类型与编号描述,更新工位组合下发菜单名称为工艺路线派工
4. 新增上传文件获取原文件名与大小的工具方法
5. 在系统管理菜单新增预警中心与附件中心入口
This commit is contained in:
SunYF
2026-09-14 16:31:08 +08:00
parent 0ab21b1234
commit 5c3b747a20
399 changed files with 147674 additions and 2213 deletions
+109
View File
@@ -0,0 +1,109 @@
// Code generated by ent, DO NOT EDIT.
package routesegment
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the routesegment type in the database.
Label = "route_segment"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldRouteId holds the string denoting the routeid field in the database.
FieldRouteId = "route_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"
// FieldStations holds the string denoting the stations field in the database.
FieldStations = "stations"
// FieldSegmentType holds the string denoting the segmenttype field in the database.
FieldSegmentType = "segment_type"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the routesegment in the database.
Table = "route_segment"
)
// Columns holds all SQL columns for routesegment fields.
var Columns = []string{
FieldID,
FieldRouteId,
FieldSeq,
FieldFlowId,
FieldStations,
FieldSegmentType,
FieldRemark,
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 (
// DefaultSeq holds the default value on creation for the "seq" field.
DefaultSeq int
// DefaultSegmentType holds the default value on creation for the "segmentType" field.
DefaultSegmentType string
// SegmentTypeValidator is a validator for the "segmentType" field. It is called by the builders before save.
SegmentTypeValidator 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.
RemarkValidator func(string) error
// 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 RouteSegment 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()
}
// ByRouteId orders the results by the routeId field.
func ByRouteId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRouteId, 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()
}
// BySegmentType orders the results by the segmentType field.
func BySegmentType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSegmentType, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
+410
View File
@@ -0,0 +1,410 @@
// Code generated by ent, DO NOT EDIT.
package routesegment
import (
"bj_power_mes/predicate"
"time"
"entgo.io/ent/dialect/sql"
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldID, id))
}
// RouteId applies equality check predicate on the "routeId" field. It's identical to RouteIdEQ.
func RouteId(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldRouteId, v))
}
// Seq applies equality check predicate on the "seq" field. It's identical to SeqEQ.
func Seq(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldSeq, v))
}
// FlowId applies equality check predicate on the "flowId" field. It's identical to FlowIdEQ.
func FlowId(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldFlowId, v))
}
// SegmentType applies equality check predicate on the "segmentType" field. It's identical to SegmentTypeEQ.
func SegmentType(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldSegmentType, v))
}
// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ.
func Remark(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldRemark, v))
}
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldCreatedAt, v))
}
// RouteIdEQ applies the EQ predicate on the "routeId" field.
func RouteIdEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldRouteId, v))
}
// RouteIdNEQ applies the NEQ predicate on the "routeId" field.
func RouteIdNEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldRouteId, v))
}
// RouteIdIn applies the In predicate on the "routeId" field.
func RouteIdIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldRouteId, vs...))
}
// RouteIdNotIn applies the NotIn predicate on the "routeId" field.
func RouteIdNotIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldRouteId, vs...))
}
// RouteIdGT applies the GT predicate on the "routeId" field.
func RouteIdGT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldRouteId, v))
}
// RouteIdGTE applies the GTE predicate on the "routeId" field.
func RouteIdGTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldRouteId, v))
}
// RouteIdLT applies the LT predicate on the "routeId" field.
func RouteIdLT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldRouteId, v))
}
// RouteIdLTE applies the LTE predicate on the "routeId" field.
func RouteIdLTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldRouteId, v))
}
// SeqEQ applies the EQ predicate on the "seq" field.
func SeqEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldSeq, v))
}
// SeqNEQ applies the NEQ predicate on the "seq" field.
func SeqNEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldSeq, v))
}
// SeqIn applies the In predicate on the "seq" field.
func SeqIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldSeq, vs...))
}
// SeqNotIn applies the NotIn predicate on the "seq" field.
func SeqNotIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldSeq, vs...))
}
// SeqGT applies the GT predicate on the "seq" field.
func SeqGT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldSeq, v))
}
// SeqGTE applies the GTE predicate on the "seq" field.
func SeqGTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldSeq, v))
}
// SeqLT applies the LT predicate on the "seq" field.
func SeqLT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldSeq, v))
}
// SeqLTE applies the LTE predicate on the "seq" field.
func SeqLTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldSeq, v))
}
// FlowIdEQ applies the EQ predicate on the "flowId" field.
func FlowIdEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldFlowId, v))
}
// FlowIdNEQ applies the NEQ predicate on the "flowId" field.
func FlowIdNEQ(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldFlowId, v))
}
// FlowIdIn applies the In predicate on the "flowId" field.
func FlowIdIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldFlowId, vs...))
}
// FlowIdNotIn applies the NotIn predicate on the "flowId" field.
func FlowIdNotIn(vs ...int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldFlowId, vs...))
}
// FlowIdGT applies the GT predicate on the "flowId" field.
func FlowIdGT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldFlowId, v))
}
// FlowIdGTE applies the GTE predicate on the "flowId" field.
func FlowIdGTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldFlowId, v))
}
// FlowIdLT applies the LT predicate on the "flowId" field.
func FlowIdLT(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldFlowId, v))
}
// FlowIdLTE applies the LTE predicate on the "flowId" field.
func FlowIdLTE(v int) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldFlowId, v))
}
// FlowIdIsNil applies the IsNil predicate on the "flowId" field.
func FlowIdIsNil() predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIsNull(FieldFlowId))
}
// FlowIdNotNil applies the NotNil predicate on the "flowId" field.
func FlowIdNotNil() predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotNull(FieldFlowId))
}
// StationsIsNil applies the IsNil predicate on the "stations" field.
func StationsIsNil() predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIsNull(FieldStations))
}
// StationsNotNil applies the NotNil predicate on the "stations" field.
func StationsNotNil() predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotNull(FieldStations))
}
// SegmentTypeEQ applies the EQ predicate on the "segmentType" field.
func SegmentTypeEQ(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldSegmentType, v))
}
// SegmentTypeNEQ applies the NEQ predicate on the "segmentType" field.
func SegmentTypeNEQ(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldSegmentType, v))
}
// SegmentTypeIn applies the In predicate on the "segmentType" field.
func SegmentTypeIn(vs ...string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldSegmentType, vs...))
}
// SegmentTypeNotIn applies the NotIn predicate on the "segmentType" field.
func SegmentTypeNotIn(vs ...string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldSegmentType, vs...))
}
// SegmentTypeGT applies the GT predicate on the "segmentType" field.
func SegmentTypeGT(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldSegmentType, v))
}
// SegmentTypeGTE applies the GTE predicate on the "segmentType" field.
func SegmentTypeGTE(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldSegmentType, v))
}
// SegmentTypeLT applies the LT predicate on the "segmentType" field.
func SegmentTypeLT(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldSegmentType, v))
}
// SegmentTypeLTE applies the LTE predicate on the "segmentType" field.
func SegmentTypeLTE(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldSegmentType, v))
}
// SegmentTypeContains applies the Contains predicate on the "segmentType" field.
func SegmentTypeContains(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldContains(FieldSegmentType, v))
}
// SegmentTypeHasPrefix applies the HasPrefix predicate on the "segmentType" field.
func SegmentTypeHasPrefix(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldHasPrefix(FieldSegmentType, v))
}
// SegmentTypeHasSuffix applies the HasSuffix predicate on the "segmentType" field.
func SegmentTypeHasSuffix(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldHasSuffix(FieldSegmentType, v))
}
// SegmentTypeEqualFold applies the EqualFold predicate on the "segmentType" field.
func SegmentTypeEqualFold(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEqualFold(FieldSegmentType, v))
}
// SegmentTypeContainsFold applies the ContainsFold predicate on the "segmentType" field.
func SegmentTypeContainsFold(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldContainsFold(FieldSegmentType, v))
}
// RemarkEQ applies the EQ predicate on the "remark" field.
func RemarkEQ(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldRemark, v))
}
// RemarkNEQ applies the NEQ predicate on the "remark" field.
func RemarkNEQ(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldRemark, v))
}
// RemarkIn applies the In predicate on the "remark" field.
func RemarkIn(vs ...string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldRemark, vs...))
}
// RemarkNotIn applies the NotIn predicate on the "remark" field.
func RemarkNotIn(vs ...string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldRemark, vs...))
}
// RemarkGT applies the GT predicate on the "remark" field.
func RemarkGT(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldRemark, v))
}
// RemarkGTE applies the GTE predicate on the "remark" field.
func RemarkGTE(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldRemark, v))
}
// RemarkLT applies the LT predicate on the "remark" field.
func RemarkLT(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldRemark, v))
}
// RemarkLTE applies the LTE predicate on the "remark" field.
func RemarkLTE(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldRemark, v))
}
// RemarkContains applies the Contains predicate on the "remark" field.
func RemarkContains(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldContains(FieldRemark, v))
}
// RemarkHasPrefix applies the HasPrefix predicate on the "remark" field.
func RemarkHasPrefix(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldHasPrefix(FieldRemark, v))
}
// RemarkHasSuffix applies the HasSuffix predicate on the "remark" field.
func RemarkHasSuffix(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldHasSuffix(FieldRemark, v))
}
// RemarkEqualFold applies the EqualFold predicate on the "remark" field.
func RemarkEqualFold(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEqualFold(FieldRemark, v))
}
// RemarkContainsFold applies the ContainsFold predicate on the "remark" field.
func RemarkContainsFold(v string) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldContainsFold(FieldRemark, v))
}
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
func CreatedAtEQ(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "createdAt" field.
func CreatedAtNEQ(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "createdAt" field.
func CreatedAtIn(vs ...time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "createdAt" field.
func CreatedAtNotIn(vs ...time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "createdAt" field.
func CreatedAtGT(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "createdAt" field.
func CreatedAtGTE(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "createdAt" field.
func CreatedAtLT(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "createdAt" field.
func CreatedAtLTE(v time.Time) predicate.RouteSegment {
return predicate.RouteSegment(sql.FieldLTE(FieldCreatedAt, v))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.RouteSegment) predicate.RouteSegment {
return predicate.RouteSegment(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.RouteSegment) predicate.RouteSegment {
return predicate.RouteSegment(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.RouteSegment) predicate.RouteSegment {
return predicate.RouteSegment(sql.NotPredicates(p))
}