feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package materialdemand
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the materialdemand type in the database.
|
||||
Label = "material_demand"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldMaterialCode holds the string denoting the material_code field in the database.
|
||||
FieldMaterialCode = "material_code"
|
||||
// FieldFuture5Qty holds the string denoting the future5_qty field in the database.
|
||||
FieldFuture5Qty = "future5_qty"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// Table holds the table name of the materialdemand in the database.
|
||||
Table = "material_demands"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for materialdemand fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldMaterialCode,
|
||||
FieldFuture5Qty,
|
||||
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 (
|
||||
// DefaultFuture5Qty holds the default value on creation for the "future5_qty" field.
|
||||
DefaultFuture5Qty int
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() int64
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the MaterialDemand 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()
|
||||
}
|
||||
|
||||
// ByMaterialCode orders the results by the material_code field.
|
||||
func ByMaterialCode(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMaterialCode, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByFuture5Qty orders the results by the future5_qty field.
|
||||
func ByFuture5Qty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldFuture5Qty, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package materialdemand
|
||||
|
||||
import (
|
||||
"bj_power_wms/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// MaterialCode applies equality check predicate on the "material_code" field. It's identical to MaterialCodeEQ.
|
||||
func MaterialCode(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// Future5Qty applies equality check predicate on the "future5_qty" field. It's identical to Future5QtyEQ.
|
||||
func Future5Qty(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// MaterialCodeEQ applies the EQ predicate on the "material_code" field.
|
||||
func MaterialCodeEQ(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeNEQ applies the NEQ predicate on the "material_code" field.
|
||||
func MaterialCodeNEQ(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNEQ(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeIn applies the In predicate on the "material_code" field.
|
||||
func MaterialCodeIn(vs ...string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldIn(FieldMaterialCode, vs...))
|
||||
}
|
||||
|
||||
// MaterialCodeNotIn applies the NotIn predicate on the "material_code" field.
|
||||
func MaterialCodeNotIn(vs ...string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNotIn(FieldMaterialCode, vs...))
|
||||
}
|
||||
|
||||
// MaterialCodeGT applies the GT predicate on the "material_code" field.
|
||||
func MaterialCodeGT(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGT(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeGTE applies the GTE predicate on the "material_code" field.
|
||||
func MaterialCodeGTE(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGTE(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeLT applies the LT predicate on the "material_code" field.
|
||||
func MaterialCodeLT(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLT(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeLTE applies the LTE predicate on the "material_code" field.
|
||||
func MaterialCodeLTE(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLTE(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeContains applies the Contains predicate on the "material_code" field.
|
||||
func MaterialCodeContains(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldContains(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeHasPrefix applies the HasPrefix predicate on the "material_code" field.
|
||||
func MaterialCodeHasPrefix(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldHasPrefix(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeHasSuffix applies the HasSuffix predicate on the "material_code" field.
|
||||
func MaterialCodeHasSuffix(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldHasSuffix(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeEqualFold applies the EqualFold predicate on the "material_code" field.
|
||||
func MaterialCodeEqualFold(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEqualFold(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// MaterialCodeContainsFold applies the ContainsFold predicate on the "material_code" field.
|
||||
func MaterialCodeContainsFold(v string) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldContainsFold(FieldMaterialCode, v))
|
||||
}
|
||||
|
||||
// Future5QtyEQ applies the EQ predicate on the "future5_qty" field.
|
||||
func Future5QtyEQ(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// Future5QtyNEQ applies the NEQ predicate on the "future5_qty" field.
|
||||
func Future5QtyNEQ(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNEQ(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// Future5QtyIn applies the In predicate on the "future5_qty" field.
|
||||
func Future5QtyIn(vs ...int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldIn(FieldFuture5Qty, vs...))
|
||||
}
|
||||
|
||||
// Future5QtyNotIn applies the NotIn predicate on the "future5_qty" field.
|
||||
func Future5QtyNotIn(vs ...int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNotIn(FieldFuture5Qty, vs...))
|
||||
}
|
||||
|
||||
// Future5QtyGT applies the GT predicate on the "future5_qty" field.
|
||||
func Future5QtyGT(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGT(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// Future5QtyGTE applies the GTE predicate on the "future5_qty" field.
|
||||
func Future5QtyGTE(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGTE(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// Future5QtyLT applies the LT predicate on the "future5_qty" field.
|
||||
func Future5QtyLT(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLT(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// Future5QtyLTE applies the LTE predicate on the "future5_qty" field.
|
||||
func Future5QtyLTE(v int) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLTE(FieldFuture5Qty, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v int64) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.MaterialDemand) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.MaterialDemand) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.MaterialDemand) predicate.MaterialDemand {
|
||||
return predicate.MaterialDemand(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user