- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
305 lines
12 KiB
Go
305 lines
12 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package inventory
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the inventory type in the database.
|
|
Label = "inventory"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldManageMode holds the string denoting the manage_mode field in the database.
|
|
FieldManageMode = "manage_mode"
|
|
// FieldCategory holds the string denoting the category field in the database.
|
|
FieldCategory = "category"
|
|
// FieldMaterialCode holds the string denoting the material_code field in the database.
|
|
FieldMaterialCode = "material_code"
|
|
// FieldMaterialName holds the string denoting the material_name field in the database.
|
|
FieldMaterialName = "material_name"
|
|
// FieldBatchNo holds the string denoting the batch_no field in the database.
|
|
FieldBatchNo = "batch_no"
|
|
// FieldSnCode holds the string denoting the sn_code field in the database.
|
|
FieldSnCode = "sn_code"
|
|
// FieldQuantity holds the string denoting the quantity field in the database.
|
|
FieldQuantity = "quantity"
|
|
// FieldLockedQty holds the string denoting the locked_qty field in the database.
|
|
FieldLockedQty = "locked_qty"
|
|
// FieldQualityStatus holds the string denoting the quality_status field in the database.
|
|
FieldQualityStatus = "quality_status"
|
|
// FieldZoneCode holds the string denoting the zone_code field in the database.
|
|
FieldZoneCode = "zone_code"
|
|
// FieldShelfNo holds the string denoting the shelf_no field in the database.
|
|
FieldShelfNo = "shelf_no"
|
|
// FieldLayerNo holds the string denoting the layer_no field in the database.
|
|
FieldLayerNo = "layer_no"
|
|
// FieldPositionNo holds the string denoting the position_no field in the database.
|
|
FieldPositionNo = "position_no"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldProductionDate holds the string denoting the production_date field in the database.
|
|
FieldProductionDate = "production_date"
|
|
// FieldSupplier holds the string denoting the supplier field in the database.
|
|
FieldSupplier = "supplier"
|
|
// FieldInboundNo holds the string denoting the inbound_no field in the database.
|
|
FieldInboundNo = "inbound_no"
|
|
// FieldOrderNo holds the string denoting the order_no field in the database.
|
|
FieldOrderNo = "order_no"
|
|
// FieldCompletedProcess holds the string denoting the completed_process field in the database.
|
|
FieldCompletedProcess = "completed_process"
|
|
// FieldOwnershipType holds the string denoting the ownership_type field in the database.
|
|
FieldOwnershipType = "ownership_type"
|
|
// FieldOwnershipNo holds the string denoting the ownership_no field in the database.
|
|
FieldOwnershipNo = "ownership_no"
|
|
// FieldProductStatus holds the string denoting the product_status field in the database.
|
|
FieldProductStatus = "product_status"
|
|
// FieldRelatedStandard holds the string denoting the related_standard field in the database.
|
|
FieldRelatedStandard = "related_standard"
|
|
// FieldTestRecordNo holds the string denoting the test_record_no field in the database.
|
|
FieldTestRecordNo = "test_record_no"
|
|
// FieldRecordedBy holds the string denoting the recorded_by field in the database.
|
|
FieldRecordedBy = "recorded_by"
|
|
// FieldRecordedAt holds the string denoting the recorded_at field in the database.
|
|
FieldRecordedAt = "recorded_at"
|
|
// FieldOutboundReason holds the string denoting the outbound_reason field in the database.
|
|
FieldOutboundReason = "outbound_reason"
|
|
// FieldRemark holds the string denoting the remark field in the database.
|
|
FieldRemark = "remark"
|
|
// 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 inventory in the database.
|
|
Table = "inventories"
|
|
)
|
|
|
|
// Columns holds all SQL columns for inventory fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldManageMode,
|
|
FieldCategory,
|
|
FieldMaterialCode,
|
|
FieldMaterialName,
|
|
FieldBatchNo,
|
|
FieldSnCode,
|
|
FieldQuantity,
|
|
FieldLockedQty,
|
|
FieldQualityStatus,
|
|
FieldZoneCode,
|
|
FieldShelfNo,
|
|
FieldLayerNo,
|
|
FieldPositionNo,
|
|
FieldStatus,
|
|
FieldProductionDate,
|
|
FieldSupplier,
|
|
FieldInboundNo,
|
|
FieldOrderNo,
|
|
FieldCompletedProcess,
|
|
FieldOwnershipType,
|
|
FieldOwnershipNo,
|
|
FieldProductStatus,
|
|
FieldRelatedStandard,
|
|
FieldTestRecordNo,
|
|
FieldRecordedBy,
|
|
FieldRecordedAt,
|
|
FieldOutboundReason,
|
|
FieldRemark,
|
|
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 (
|
|
// DefaultCategory holds the default value on creation for the "category" field.
|
|
DefaultCategory int
|
|
// DefaultQuantity holds the default value on creation for the "quantity" field.
|
|
DefaultQuantity int
|
|
// DefaultLockedQty holds the default value on creation for the "locked_qty" field.
|
|
DefaultLockedQty int
|
|
// DefaultQualityStatus holds the default value on creation for the "quality_status" field.
|
|
DefaultQualityStatus string
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
DefaultStatus string
|
|
// DefaultOrderNo holds the default value on creation for the "order_no" field.
|
|
DefaultOrderNo string
|
|
// OrderNoValidator is a validator for the "order_no" field. It is called by the builders before save.
|
|
OrderNoValidator func(string) error
|
|
// DefaultCompletedProcess holds the default value on creation for the "completed_process" field.
|
|
DefaultCompletedProcess string
|
|
// CompletedProcessValidator is a validator for the "completed_process" field. It is called by the builders before save.
|
|
CompletedProcessValidator func(string) error
|
|
// 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 Inventory 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()
|
|
}
|
|
|
|
// ByManageMode orders the results by the manage_mode field.
|
|
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCategory orders the results by the category field.
|
|
func ByCategory(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCategory, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMaterialCode orders the results by the material_code field.
|
|
func ByMaterialCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMaterialCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMaterialName orders the results by the material_name field.
|
|
func ByMaterialName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMaterialName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBatchNo orders the results by the batch_no field.
|
|
func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
|
|
}
|
|
|
|
// BySnCode orders the results by the sn_code field.
|
|
func BySnCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSnCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByQuantity orders the results by the quantity field.
|
|
func ByQuantity(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldQuantity, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLockedQty orders the results by the locked_qty field.
|
|
func ByLockedQty(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLockedQty, opts...).ToFunc()
|
|
}
|
|
|
|
// ByQualityStatus orders the results by the quality_status field.
|
|
func ByQualityStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldQualityStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByZoneCode orders the results by the zone_code field.
|
|
func ByZoneCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldZoneCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByShelfNo orders the results by the shelf_no field.
|
|
func ByShelfNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldShelfNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLayerNo orders the results by the layer_no field.
|
|
func ByLayerNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLayerNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPositionNo orders the results by the position_no field.
|
|
func ByPositionNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPositionNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductionDate orders the results by the production_date field.
|
|
func ByProductionDate(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductionDate, opts...).ToFunc()
|
|
}
|
|
|
|
// BySupplier orders the results by the supplier field.
|
|
func BySupplier(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSupplier, opts...).ToFunc()
|
|
}
|
|
|
|
// ByInboundNo orders the results by the inbound_no field.
|
|
func ByInboundNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldInboundNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOrderNo orders the results by the order_no field.
|
|
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCompletedProcess orders the results by the completed_process field.
|
|
func ByCompletedProcess(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCompletedProcess, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOwnershipType orders the results by the ownership_type field.
|
|
func ByOwnershipType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnershipType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOwnershipNo orders the results by the ownership_no field.
|
|
func ByOwnershipNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnershipNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProductStatus orders the results by the product_status field.
|
|
func ByProductStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldProductStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRelatedStandard orders the results by the related_standard field.
|
|
func ByRelatedStandard(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRelatedStandard, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTestRecordNo orders the results by the test_record_no field.
|
|
func ByTestRecordNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTestRecordNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRecordedBy orders the results by the recorded_by field.
|
|
func ByRecordedBy(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRecordedBy, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRecordedAt orders the results by the recorded_at field.
|
|
func ByRecordedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRecordedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOutboundReason orders the results by the outbound_reason field.
|
|
func ByOutboundReason(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOutboundReason, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRemark orders the results by the remark field.
|
|
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRemark, 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()
|
|
}
|