feat: 新增预警与附件模块,优化工位派工功能
1. 新增预警规则、预警消息、业务附件数据库表与CRUD逻辑 2. 为拧紧记录添加审核人、审核时间字段及审核留痕功能 3. 优化产线点位类型与编号描述,更新工位组合下发菜单名称为工艺路线派工 4. 新增上传文件获取原文件名与大小的工具方法 5. 在系统管理菜单新增预警中心与附件中心入口
This commit is contained in:
+13
-27
@@ -4,8 +4,6 @@ package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
stdsql "database/sql"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"entgo.io/ent/dialect"
|
||||
@@ -14,8 +12,14 @@ import (
|
||||
// Tx is a transactional client that is created by calling Client.Tx().
|
||||
type Tx struct {
|
||||
config
|
||||
// Alert is the client for interacting with the Alert builders.
|
||||
Alert *AlertClient
|
||||
// AlertRule is the client for interacting with the AlertRule builders.
|
||||
AlertRule *AlertRuleClient
|
||||
// AssociationTrace is the client for interacting with the AssociationTrace builders.
|
||||
AssociationTrace *AssociationTraceClient
|
||||
// Attachment is the client for interacting with the Attachment builders.
|
||||
Attachment *AttachmentClient
|
||||
// BomItem is the client for interacting with the BomItem builders.
|
||||
BomItem *BomItemClient
|
||||
// DailyPlan is the client for interacting with the DailyPlan builders.
|
||||
@@ -58,6 +62,8 @@ type Tx struct {
|
||||
StepCriterion *StepCriterionClient
|
||||
// StepData is the client for interacting with the StepData builders.
|
||||
StepData *StepDataClient
|
||||
// TorqueAuditLog is the client for interacting with the TorqueAuditLog builders.
|
||||
TorqueAuditLog *TorqueAuditLogClient
|
||||
// TorqueRecord is the client for interacting with the TorqueRecord builders.
|
||||
TorqueRecord *TorqueRecordClient
|
||||
// User is the client for interacting with the User builders.
|
||||
@@ -203,7 +209,10 @@ func (tx *Tx) Client() *Client {
|
||||
}
|
||||
|
||||
func (tx *Tx) init() {
|
||||
tx.Alert = NewAlertClient(tx.config)
|
||||
tx.AlertRule = NewAlertRuleClient(tx.config)
|
||||
tx.AssociationTrace = NewAssociationTraceClient(tx.config)
|
||||
tx.Attachment = NewAttachmentClient(tx.config)
|
||||
tx.BomItem = NewBomItemClient(tx.config)
|
||||
tx.DailyPlan = NewDailyPlanClient(tx.config)
|
||||
tx.EventLog = NewEventLogClient(tx.config)
|
||||
@@ -225,6 +234,7 @@ func (tx *Tx) init() {
|
||||
tx.StationProcess = NewStationProcessClient(tx.config)
|
||||
tx.StepCriterion = NewStepCriterionClient(tx.config)
|
||||
tx.StepData = NewStepDataClient(tx.config)
|
||||
tx.TorqueAuditLog = NewTorqueAuditLogClient(tx.config)
|
||||
tx.TorqueRecord = NewTorqueRecordClient(tx.config)
|
||||
tx.User = NewUserClient(tx.config)
|
||||
tx.UserStation = NewUserStationClient(tx.config)
|
||||
@@ -241,7 +251,7 @@ func (tx *Tx) init() {
|
||||
// of them in order to commit or rollback the transaction.
|
||||
//
|
||||
// If a closed transaction is embedded in one of the generated entities, and the entity
|
||||
// applies a query, for example: AssociationTrace.QueryXXX(), the query will be executed
|
||||
// applies a query, for example: Alert.QueryXXX(), the query will be executed
|
||||
// through the driver which created this transaction.
|
||||
//
|
||||
// Note that txDriver is not goroutine safe.
|
||||
@@ -294,27 +304,3 @@ func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error
|
||||
}
|
||||
|
||||
var _ dialect.Driver = (*txDriver)(nil)
|
||||
|
||||
// ExecContext allows calling the underlying ExecContext method of the transaction if it is supported by it.
|
||||
// See, database/sql#Tx.ExecContext for more information.
|
||||
func (tx *txDriver) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error) {
|
||||
ex, ok := tx.tx.(interface {
|
||||
ExecContext(context.Context, string, ...any) (stdsql.Result, error)
|
||||
})
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Tx.ExecContext is not supported")
|
||||
}
|
||||
return ex.ExecContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
// QueryContext allows calling the underlying QueryContext method of the transaction if it is supported by it.
|
||||
// See, database/sql#Tx.QueryContext for more information.
|
||||
func (tx *txDriver) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error) {
|
||||
q, ok := tx.tx.(interface {
|
||||
QueryContext(context.Context, string, ...any) (*stdsql.Rows, error)
|
||||
})
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Tx.QueryContext is not supported")
|
||||
}
|
||||
return q.QueryContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user