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 (
|
||||
FieldStartedAt = "started_at"
|
||||
// FieldEndedAt holds the string denoting the endedat field in the database.
|
||||
FieldEndedAt = "ended_at"
|
||||
// FieldDurationSec holds the string denoting the durationsec field in the database.
|
||||
FieldDurationSec = "duration_sec"
|
||||
// FieldRemark holds the string denoting the remark field in the database.
|
||||
FieldRemark = "remark"
|
||||
// FieldCreatedAt holds the string denoting the createdat field in the database.
|
||||
@@ -54,6 +56,7 @@ var Columns = []string{
|
||||
FieldResult,
|
||||
FieldStartedAt,
|
||||
FieldEndedAt,
|
||||
FieldDurationSec,
|
||||
FieldRemark,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
@@ -95,6 +98,8 @@ var (
|
||||
DefaultResult string
|
||||
// ResultValidator is a validator for the "result" field. It is called by the builders before save.
|
||||
ResultValidator func(string) error
|
||||
// DefaultDurationSec holds the default value on creation for the "durationSec" field.
|
||||
DefaultDurationSec int
|
||||
// DefaultRemark holds the default value on creation for the "remark" field.
|
||||
DefaultRemark string
|
||||
// RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
|
||||
@@ -163,6 +168,11 @@ func ByEndedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEndedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDurationSec orders the results by the durationSec field.
|
||||
func ByDurationSec(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDurationSec, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRemark orders the results by the remark field.
|
||||
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRemark, opts...).ToFunc()
|
||||
|
||||
Reference in New Issue
Block a user