Files
bj_power/bj_power_mes/schema/torque_audit_log.go
T
SunYF 5c3b747a20 feat: 新增预警与附件模块,优化工位派工功能
1. 新增预警规则、预警消息、业务附件数据库表与CRUD逻辑
2. 为拧紧记录添加审核人、审核时间字段及审核留痕功能
3. 优化产线点位类型与编号描述,更新工位组合下发菜单名称为工艺路线派工
4. 新增上传文件获取原文件名与大小的工具方法
5. 在系统管理菜单新增预警中心与附件中心入口
2026-09-14 16:31:08 +08:00

42 lines
1.2 KiB
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// TorqueAuditLog 拧紧记录修改留痕(审核签字 / 补录 / 修正,谁在何时改了什么)
type TorqueAuditLog struct {
ent.Schema
}
func (TorqueAuditLog) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "torque_audit_log"}}
}
func (TorqueAuditLog) Fields() []ent.Field {
return []ent.Field{
field.Int("id").Positive(),
field.Int("torqueRecordId").Comment("拧紧记录ID"),
field.String("action").MaxLen(20).Comment("审核/补录/修正"),
field.String("fieldName").Default("").MaxLen(40).Comment("字段名"),
field.String("oldVal").Default("").MaxLen(255).Comment("改前"),
field.String("newVal").Default("").MaxLen(255).Comment("改后"),
field.String("operator").MaxLen(64).Comment("操作人"),
field.String("remark").Default("").MaxLen(255).Comment("备注/原因"),
field.Time("createdAt").Default(time.Now).Immutable(),
}
}
func (TorqueAuditLog) Indexes() []ent.Index {
return []ent.Index{
index.Fields("torqueRecordId"),
index.Fields("createdAt"),
}
}