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

171 lines
6.0 KiB
Go

// Code generated by ent, DO NOT EDIT.
package material
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the material type in the database.
Label = "material"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCode holds the string denoting the code field in the database.
FieldCode = "code"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldSpec holds the string denoting the spec field in the database.
FieldSpec = "spec"
// FieldUnit holds the string denoting the unit field in the database.
FieldUnit = "unit"
// FieldDescription holds the string denoting the description field in the database.
FieldDescription = "description"
// FieldItemType holds the string denoting the item_type field in the database.
FieldItemType = "item_type"
// FieldManageMode holds the string denoting the manage_mode field in the database.
FieldManageMode = "manage_mode"
// FieldIsBatchManaged holds the string denoting the is_batch_managed field in the database.
FieldIsBatchManaged = "is_batch_managed"
// FieldIsSerialManaged holds the string denoting the is_serial_managed field in the database.
FieldIsSerialManaged = "is_serial_managed"
// FieldTemplateCode holds the string denoting the template_code field in the database.
FieldTemplateCode = "template_code"
// FieldSafetyStock holds the string denoting the safety_stock field in the database.
FieldSafetyStock = "safety_stock"
// FieldIsActive holds the string denoting the is_active field in the database.
FieldIsActive = "is_active"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the material in the database.
Table = "materials"
)
// Columns holds all SQL columns for material fields.
var Columns = []string{
FieldID,
FieldCode,
FieldName,
FieldSpec,
FieldUnit,
FieldDescription,
FieldItemType,
FieldManageMode,
FieldIsBatchManaged,
FieldIsSerialManaged,
FieldTemplateCode,
FieldSafetyStock,
FieldIsActive,
FieldCreatedAt,
FieldUpdatedAt,
}
// 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 (
// DefaultItemType holds the default value on creation for the "item_type" field.
DefaultItemType int
// DefaultManageMode holds the default value on creation for the "manage_mode" field.
DefaultManageMode int
// DefaultIsBatchManaged holds the default value on creation for the "is_batch_managed" field.
DefaultIsBatchManaged bool
// DefaultIsSerialManaged holds the default value on creation for the "is_serial_managed" field.
DefaultIsSerialManaged bool
// DefaultSafetyStock holds the default value on creation for the "safety_stock" field.
DefaultSafetyStock int
// DefaultIsActive holds the default value on creation for the "is_active" field.
DefaultIsActive bool
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() int64
)
// OrderOption defines the ordering options for the Material 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()
}
// ByCode orders the results by the code field.
func ByCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCode, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// BySpec orders the results by the spec field.
func BySpec(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSpec, opts...).ToFunc()
}
// ByUnit orders the results by the unit field.
func ByUnit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUnit, opts...).ToFunc()
}
// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
// ByItemType orders the results by the item_type field.
func ByItemType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldItemType, opts...).ToFunc()
}
// ByManageMode orders the results by the manage_mode field.
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
}
// ByIsBatchManaged orders the results by the is_batch_managed field.
func ByIsBatchManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsBatchManaged, opts...).ToFunc()
}
// ByIsSerialManaged orders the results by the is_serial_managed field.
func ByIsSerialManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsSerialManaged, opts...).ToFunc()
}
// ByTemplateCode orders the results by the template_code field.
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
}
// BySafetyStock orders the results by the safety_stock field.
func BySafetyStock(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSafetyStock, opts...).ToFunc()
}
// ByIsActive orders the results by the is_active field.
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsActive, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}