feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -33,6 +33,8 @@ const (
|
||||
FieldUnitQty = "unit_qty"
|
||||
// FieldLossRate holds the string denoting the lossrate field in the database.
|
||||
FieldLossRate = "loss_rate"
|
||||
// FieldRelatedStandard holds the string denoting the relatedstandard field in the database.
|
||||
FieldRelatedStandard = "related_standard"
|
||||
// FieldRequiredQty holds the string denoting the requiredqty field in the database.
|
||||
FieldRequiredQty = "required_qty"
|
||||
// FieldSerialSns holds the string denoting the serialsns field in the database.
|
||||
@@ -56,6 +58,7 @@ var Columns = []string{
|
||||
FieldProcessCode,
|
||||
FieldUnitQty,
|
||||
FieldLossRate,
|
||||
FieldRelatedStandard,
|
||||
FieldRequiredQty,
|
||||
FieldSerialSns,
|
||||
FieldCreatedAt,
|
||||
@@ -104,6 +107,10 @@ var (
|
||||
DefaultUnitQty float64
|
||||
// DefaultLossRate holds the default value on creation for the "lossRate" field.
|
||||
DefaultLossRate float64
|
||||
// DefaultRelatedStandard holds the default value on creation for the "relatedStandard" field.
|
||||
DefaultRelatedStandard string
|
||||
// RelatedStandardValidator is a validator for the "relatedStandard" field. It is called by the builders before save.
|
||||
RelatedStandardValidator func(string) error
|
||||
// DefaultRequiredQty holds the default value on creation for the "requiredQty" field.
|
||||
DefaultRequiredQty float64
|
||||
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
|
||||
@@ -170,6 +177,11 @@ func ByLossRate(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldLossRate, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRelatedStandard orders the results by the relatedStandard field.
|
||||
func ByRelatedStandard(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRelatedStandard, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRequiredQty orders the results by the requiredQty field.
|
||||
func ByRequiredQty(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRequiredQty, opts...).ToFunc()
|
||||
|
||||
Reference in New Issue
Block a user