Files
bj_power/bj_power_wms/ent/attachment/attachment.go
T
SunYF 62e45b7379 feat: 完成附件存储重构与磁盘监控功能,同步物料档案与入库单规则更新
1.  新增跨平台磁盘空间监控能力,每日7点自动检测附件目录剩余空间,触发阈值告警
2.  重构附件存储方案为年/月/日/文件类型分层结构,统一MES与WMS的附件管理逻辑
3.  对齐物料档案与入库单的质量状态校验规则,仅合格品计入库存与出库
4.  实现入库单作废功能与区域库位的多级父子结构管理
5.  删除物料简称字段,补充规格型号与单位必填项,统一系统数据口径
6.  新增附件中心与磁盘状态查询接口,完善权限控制与操作日志
2026-09-19 10:54:15 +08:00

179 lines
6.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package attachment
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the attachment type in the database.
Label = "attachment"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldBizType holds the string denoting the biz_type field in the database.
FieldBizType = "biz_type"
// FieldBizID holds the string denoting the biz_id field in the database.
FieldBizID = "biz_id"
// FieldFileName holds the string denoting the file_name field in the database.
FieldFileName = "file_name"
// FieldFilePath holds the string denoting the file_path field in the database.
FieldFilePath = "file_path"
// FieldFileType holds the string denoting the file_type field in the database.
FieldFileType = "file_type"
// FieldFileExt holds the string denoting the file_ext field in the database.
FieldFileExt = "file_ext"
// FieldFileMd5 holds the string denoting the file_md5 field in the database.
FieldFileMd5 = "file_md5"
// FieldFileSize holds the string denoting the file_size field in the database.
FieldFileSize = "file_size"
// FieldMimeType holds the string denoting the mime_type field in the database.
FieldMimeType = "mime_type"
// FieldUploadedBy holds the string denoting the uploaded_by field in the database.
FieldUploadedBy = "uploaded_by"
// FieldArchived holds the string denoting the archived field in the database.
FieldArchived = "archived"
// FieldArchivedAt holds the string denoting the archived_at field in the database.
FieldArchivedAt = "archived_at"
// FieldDeleted holds the string denoting the deleted field in the database.
FieldDeleted = "deleted"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldDeletedBy holds the string denoting the deleted_by field in the database.
FieldDeletedBy = "deleted_by"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the attachment in the database.
Table = "attachments"
)
// Columns holds all SQL columns for attachment fields.
var Columns = []string{
FieldID,
FieldBizType,
FieldBizID,
FieldFileName,
FieldFilePath,
FieldFileType,
FieldFileExt,
FieldFileMd5,
FieldFileSize,
FieldMimeType,
FieldUploadedBy,
FieldArchived,
FieldArchivedAt,
FieldDeleted,
FieldDeletedAt,
FieldDeletedBy,
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 (
// DefaultFileSize holds the default value on creation for the "file_size" field.
DefaultFileSize int64
// DefaultArchived holds the default value on creation for the "archived" field.
DefaultArchived bool
// DefaultDeleted holds the default value on creation for the "deleted" field.
DefaultDeleted bool
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
)
// OrderOption defines the ordering options for the Attachment 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()
}
// ByBizType orders the results by the biz_type field.
func ByBizType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBizType, opts...).ToFunc()
}
// ByBizID orders the results by the biz_id field.
func ByBizID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBizID, opts...).ToFunc()
}
// ByFileName orders the results by the file_name field.
func ByFileName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFileName, opts...).ToFunc()
}
// ByFilePath orders the results by the file_path field.
func ByFilePath(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFilePath, opts...).ToFunc()
}
// ByFileType orders the results by the file_type field.
func ByFileType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFileType, opts...).ToFunc()
}
// ByFileExt orders the results by the file_ext field.
func ByFileExt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFileExt, opts...).ToFunc()
}
// ByFileMd5 orders the results by the file_md5 field.
func ByFileMd5(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFileMd5, opts...).ToFunc()
}
// ByFileSize orders the results by the file_size field.
func ByFileSize(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFileSize, opts...).ToFunc()
}
// ByMimeType orders the results by the mime_type field.
func ByMimeType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMimeType, opts...).ToFunc()
}
// ByUploadedBy orders the results by the uploaded_by field.
func ByUploadedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUploadedBy, opts...).ToFunc()
}
// ByArchived orders the results by the archived field.
func ByArchived(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldArchived, opts...).ToFunc()
}
// ByArchivedAt orders the results by the archived_at field.
func ByArchivedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldArchivedAt, opts...).ToFunc()
}
// ByDeleted orders the results by the deleted field.
func ByDeleted(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeleted, opts...).ToFunc()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByDeletedBy orders the results by the deleted_by field.
func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedBy, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}