feat: 两库对等物料管理及产品工号贯通全流程
- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步 - 全流程新增产品工号字段,贯通入库/库存/出库/检验环节 - 工单管理支持多工单混产,移除单工单互斥限制 - 新增批次号/SN 字段支持质量检验联动 WMS 库存处置 - 修复权限规则,仅内置管理员账号不允许修改删除 - 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
@@ -0,0 +1,184 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package material
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"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 itemtype field in the database.
|
||||
FieldItemType = "item_type"
|
||||
// FieldManageMode holds the string denoting the managemode field in the database.
|
||||
FieldManageMode = "manage_mode"
|
||||
// FieldTemplateCode holds the string denoting the templatecode field in the database.
|
||||
FieldTemplateCode = "template_code"
|
||||
// FieldSafetyStock holds the string denoting the safetystock field in the database.
|
||||
FieldSafetyStock = "safety_stock"
|
||||
// FieldIsActive holds the string denoting the isactive field in the database.
|
||||
FieldIsActive = "is_active"
|
||||
// FieldSyncPending holds the string denoting the syncpending field in the database.
|
||||
FieldSyncPending = "sync_pending"
|
||||
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdatedAt holds the string denoting the updatedat 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,
|
||||
FieldTemplateCode,
|
||||
FieldSafetyStock,
|
||||
FieldIsActive,
|
||||
FieldSyncPending,
|
||||
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 (
|
||||
// CodeValidator is a validator for the "code" field. It is called by the builders before save.
|
||||
CodeValidator func(string) error
|
||||
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
NameValidator func(string) error
|
||||
// DefaultSpec holds the default value on creation for the "spec" field.
|
||||
DefaultSpec string
|
||||
// SpecValidator is a validator for the "spec" field. It is called by the builders before save.
|
||||
SpecValidator func(string) error
|
||||
// DefaultUnit holds the default value on creation for the "unit" field.
|
||||
DefaultUnit string
|
||||
// UnitValidator is a validator for the "unit" field. It is called by the builders before save.
|
||||
UnitValidator func(string) error
|
||||
// DefaultDescription holds the default value on creation for the "description" field.
|
||||
DefaultDescription string
|
||||
// DescriptionValidator is a validator for the "description" field. It is called by the builders before save.
|
||||
DescriptionValidator func(string) error
|
||||
// DefaultItemType holds the default value on creation for the "itemType" field.
|
||||
DefaultItemType int
|
||||
// DefaultManageMode holds the default value on creation for the "manageMode" field.
|
||||
DefaultManageMode int
|
||||
// DefaultTemplateCode holds the default value on creation for the "templateCode" field.
|
||||
DefaultTemplateCode string
|
||||
// TemplateCodeValidator is a validator for the "templateCode" field. It is called by the builders before save.
|
||||
TemplateCodeValidator func(string) error
|
||||
// DefaultSafetyStock holds the default value on creation for the "safetyStock" field.
|
||||
DefaultSafetyStock int
|
||||
// DefaultIsActive holds the default value on creation for the "isActive" field.
|
||||
DefaultIsActive bool
|
||||
// DefaultSyncPending holds the default value on creation for the "syncPending" field.
|
||||
DefaultSyncPending bool
|
||||
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updatedAt" field.
|
||||
DefaultUpdatedAt func() time.Time
|
||||
// UpdateDefaultUpdatedAt holds the default value on update for the "updatedAt" field.
|
||||
UpdateDefaultUpdatedAt func() time.Time
|
||||
)
|
||||
|
||||
// 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 itemType field.
|
||||
func ByItemType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldItemType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByManageMode orders the results by the manageMode field.
|
||||
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTemplateCode orders the results by the templateCode field.
|
||||
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySafetyStock orders the results by the safetyStock field.
|
||||
func BySafetyStock(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSafetyStock, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIsActive orders the results by the isActive field.
|
||||
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIsActive, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySyncPending orders the results by the syncPending field.
|
||||
func BySyncPending(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSyncPending, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the createdAt field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updatedAt field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
Reference in New Issue
Block a user