- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
97 lines
3.2 KiB
Go
97 lines
3.2 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package produciblesnapshot
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the produciblesnapshot type in the database.
|
|
Label = "producible_snapshot"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldProductCode holds the string denoting the product_code field in the database.
|
|
FieldProductCode = "product_code"
|
|
// FieldProductName holds the string denoting the product_name field in the database.
|
|
FieldProductName = "product_name"
|
|
// FieldProducibleQty holds the string denoting the producible_qty field in the database.
|
|
FieldProducibleQty = "producible_qty"
|
|
// FieldShortText holds the string denoting the short_text field in the database.
|
|
FieldShortText = "short_text"
|
|
// FieldComputedAt holds the string denoting the computed_at field in the database.
|
|
FieldComputedAt = "computed_at"
|
|
// FieldSyncedAt holds the string denoting the synced_at field in the database.
|
|
FieldSyncedAt = "synced_at"
|
|
// Table holds the table name of the produciblesnapshot in the database.
|
|
Table = "producible_snapshots"
|
|
)
|
|
|
|
// Columns holds all SQL columns for produciblesnapshot fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldProductCode,
|
|
FieldProductName,
|
|
FieldProducibleQty,
|
|
FieldShortText,
|
|
FieldComputedAt,
|
|
FieldSyncedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultProducibleQty holds the default value on creation for the "producible_qty" field.
|
|
DefaultProducibleQty int
|
|
// DefaultComputedAt holds the default value on creation for the "computed_at" field.
|
|
DefaultComputedAt int64
|
|
// DefaultSyncedAt holds the default value on creation for the "synced_at" field.
|
|
DefaultSyncedAt func() int64
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the ProducibleSnapshot 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()
|
|
}
|
|
|
|
// ByProductCode orders the results by the product_code field.
|
|
func ByProductCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductName orders the results by the product_name field.
|
|
func ByProductName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProducibleQty orders the results by the producible_qty field.
|
|
func ByProducibleQty(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProducibleQty, opts...).ToFunc()
|
|
}
|
|
|
|
// ByShortText orders the results by the short_text field.
|
|
func ByShortText(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldShortText, opts...).ToFunc()
|
|
}
|
|
|
|
// ByComputedAt orders the results by the computed_at field.
|
|
func ByComputedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldComputedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// BySyncedAt orders the results by the synced_at field.
|
|
func BySyncedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSyncedAt, opts...).ToFunc()
|
|
}
|