feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -21,6 +21,12 @@ const (
|
||||
FieldMaterialCode = "material_code"
|
||||
// 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"
|
||||
// FieldBookQty holds the string denoting the book_qty field in the database.
|
||||
FieldBookQty = "book_qty"
|
||||
// FieldScannedQty holds the string denoting the scanned_qty field in the database.
|
||||
@@ -43,6 +49,9 @@ var Columns = []string{
|
||||
FieldTargetID,
|
||||
FieldMaterialCode,
|
||||
FieldZoneCode,
|
||||
FieldShelfNo,
|
||||
FieldLayerNo,
|
||||
FieldPositionNo,
|
||||
FieldBookQty,
|
||||
FieldScannedQty,
|
||||
FieldDiffQty,
|
||||
@@ -106,6 +115,21 @@ 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()
|
||||
}
|
||||
|
||||
// ByBookQty orders the results by the book_qty field.
|
||||
func ByBookQty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldBookQty, opts...).ToFunc()
|
||||
|
||||
@@ -78,6 +78,21 @@ func ZoneCode(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldZoneCode, v))
|
||||
}
|
||||
|
||||
// ShelfNo applies equality check predicate on the "shelf_no" field. It's identical to ShelfNoEQ.
|
||||
func ShelfNo(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// LayerNo applies equality check predicate on the "layer_no" field. It's identical to LayerNoEQ.
|
||||
func LayerNo(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// PositionNo applies equality check predicate on the "position_no" field. It's identical to PositionNoEQ.
|
||||
func PositionNo(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// BookQty applies equality check predicate on the "book_qty" field. It's identical to BookQtyEQ.
|
||||
func BookQty(v int) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldBookQty, v))
|
||||
@@ -448,6 +463,231 @@ func ZoneCodeContainsFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContainsFold(FieldZoneCode, v))
|
||||
}
|
||||
|
||||
// ShelfNoEQ applies the EQ predicate on the "shelf_no" field.
|
||||
func ShelfNoEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoNEQ applies the NEQ predicate on the "shelf_no" field.
|
||||
func ShelfNoNEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNEQ(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoIn applies the In predicate on the "shelf_no" field.
|
||||
func ShelfNoIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIn(FieldShelfNo, vs...))
|
||||
}
|
||||
|
||||
// ShelfNoNotIn applies the NotIn predicate on the "shelf_no" field.
|
||||
func ShelfNoNotIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotIn(FieldShelfNo, vs...))
|
||||
}
|
||||
|
||||
// ShelfNoGT applies the GT predicate on the "shelf_no" field.
|
||||
func ShelfNoGT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGT(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoGTE applies the GTE predicate on the "shelf_no" field.
|
||||
func ShelfNoGTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGTE(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoLT applies the LT predicate on the "shelf_no" field.
|
||||
func ShelfNoLT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLT(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoLTE applies the LTE predicate on the "shelf_no" field.
|
||||
func ShelfNoLTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLTE(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoContains applies the Contains predicate on the "shelf_no" field.
|
||||
func ShelfNoContains(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContains(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoHasPrefix applies the HasPrefix predicate on the "shelf_no" field.
|
||||
func ShelfNoHasPrefix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasPrefix(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoHasSuffix applies the HasSuffix predicate on the "shelf_no" field.
|
||||
func ShelfNoHasSuffix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasSuffix(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoIsNil applies the IsNil predicate on the "shelf_no" field.
|
||||
func ShelfNoIsNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIsNull(FieldShelfNo))
|
||||
}
|
||||
|
||||
// ShelfNoNotNil applies the NotNil predicate on the "shelf_no" field.
|
||||
func ShelfNoNotNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotNull(FieldShelfNo))
|
||||
}
|
||||
|
||||
// ShelfNoEqualFold applies the EqualFold predicate on the "shelf_no" field.
|
||||
func ShelfNoEqualFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEqualFold(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// ShelfNoContainsFold applies the ContainsFold predicate on the "shelf_no" field.
|
||||
func ShelfNoContainsFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContainsFold(FieldShelfNo, v))
|
||||
}
|
||||
|
||||
// LayerNoEQ applies the EQ predicate on the "layer_no" field.
|
||||
func LayerNoEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoNEQ applies the NEQ predicate on the "layer_no" field.
|
||||
func LayerNoNEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNEQ(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoIn applies the In predicate on the "layer_no" field.
|
||||
func LayerNoIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIn(FieldLayerNo, vs...))
|
||||
}
|
||||
|
||||
// LayerNoNotIn applies the NotIn predicate on the "layer_no" field.
|
||||
func LayerNoNotIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotIn(FieldLayerNo, vs...))
|
||||
}
|
||||
|
||||
// LayerNoGT applies the GT predicate on the "layer_no" field.
|
||||
func LayerNoGT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGT(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoGTE applies the GTE predicate on the "layer_no" field.
|
||||
func LayerNoGTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGTE(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoLT applies the LT predicate on the "layer_no" field.
|
||||
func LayerNoLT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLT(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoLTE applies the LTE predicate on the "layer_no" field.
|
||||
func LayerNoLTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLTE(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoContains applies the Contains predicate on the "layer_no" field.
|
||||
func LayerNoContains(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContains(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoHasPrefix applies the HasPrefix predicate on the "layer_no" field.
|
||||
func LayerNoHasPrefix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasPrefix(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoHasSuffix applies the HasSuffix predicate on the "layer_no" field.
|
||||
func LayerNoHasSuffix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasSuffix(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoIsNil applies the IsNil predicate on the "layer_no" field.
|
||||
func LayerNoIsNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIsNull(FieldLayerNo))
|
||||
}
|
||||
|
||||
// LayerNoNotNil applies the NotNil predicate on the "layer_no" field.
|
||||
func LayerNoNotNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotNull(FieldLayerNo))
|
||||
}
|
||||
|
||||
// LayerNoEqualFold applies the EqualFold predicate on the "layer_no" field.
|
||||
func LayerNoEqualFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEqualFold(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// LayerNoContainsFold applies the ContainsFold predicate on the "layer_no" field.
|
||||
func LayerNoContainsFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContainsFold(FieldLayerNo, v))
|
||||
}
|
||||
|
||||
// PositionNoEQ applies the EQ predicate on the "position_no" field.
|
||||
func PositionNoEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoNEQ applies the NEQ predicate on the "position_no" field.
|
||||
func PositionNoNEQ(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNEQ(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoIn applies the In predicate on the "position_no" field.
|
||||
func PositionNoIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIn(FieldPositionNo, vs...))
|
||||
}
|
||||
|
||||
// PositionNoNotIn applies the NotIn predicate on the "position_no" field.
|
||||
func PositionNoNotIn(vs ...string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotIn(FieldPositionNo, vs...))
|
||||
}
|
||||
|
||||
// PositionNoGT applies the GT predicate on the "position_no" field.
|
||||
func PositionNoGT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGT(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoGTE applies the GTE predicate on the "position_no" field.
|
||||
func PositionNoGTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldGTE(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoLT applies the LT predicate on the "position_no" field.
|
||||
func PositionNoLT(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLT(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoLTE applies the LTE predicate on the "position_no" field.
|
||||
func PositionNoLTE(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldLTE(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoContains applies the Contains predicate on the "position_no" field.
|
||||
func PositionNoContains(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContains(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoHasPrefix applies the HasPrefix predicate on the "position_no" field.
|
||||
func PositionNoHasPrefix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasPrefix(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoHasSuffix applies the HasSuffix predicate on the "position_no" field.
|
||||
func PositionNoHasSuffix(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldHasSuffix(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoIsNil applies the IsNil predicate on the "position_no" field.
|
||||
func PositionNoIsNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldIsNull(FieldPositionNo))
|
||||
}
|
||||
|
||||
// PositionNoNotNil applies the NotNil predicate on the "position_no" field.
|
||||
func PositionNoNotNil() predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldNotNull(FieldPositionNo))
|
||||
}
|
||||
|
||||
// PositionNoEqualFold applies the EqualFold predicate on the "position_no" field.
|
||||
func PositionNoEqualFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEqualFold(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// PositionNoContainsFold applies the ContainsFold predicate on the "position_no" field.
|
||||
func PositionNoContainsFold(v string) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldContainsFold(FieldPositionNo, v))
|
||||
}
|
||||
|
||||
// BookQtyEQ applies the EQ predicate on the "book_qty" field.
|
||||
func BookQtyEQ(v int) predicate.StocktakeItem {
|
||||
return predicate.StocktakeItem(sql.FieldEQ(FieldBookQty, v))
|
||||
|
||||
Reference in New Issue
Block a user