feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -104,6 +104,11 @@ func EndedAt(v time.Time) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldEndedAt, v))
|
||||
}
|
||||
|
||||
// DurationSec applies equality check predicate on the "durationSec" field. It's identical to DurationSecEQ.
|
||||
func DurationSec(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ.
|
||||
func Remark(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldRemark, v))
|
||||
@@ -709,6 +714,46 @@ func EndedAtNotNil() predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldNotNull(FieldEndedAt))
|
||||
}
|
||||
|
||||
// DurationSecEQ applies the EQ predicate on the "durationSec" field.
|
||||
func DurationSecEQ(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// DurationSecNEQ applies the NEQ predicate on the "durationSec" field.
|
||||
func DurationSecNEQ(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldNEQ(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// DurationSecIn applies the In predicate on the "durationSec" field.
|
||||
func DurationSecIn(vs ...int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldIn(FieldDurationSec, vs...))
|
||||
}
|
||||
|
||||
// DurationSecNotIn applies the NotIn predicate on the "durationSec" field.
|
||||
func DurationSecNotIn(vs ...int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldNotIn(FieldDurationSec, vs...))
|
||||
}
|
||||
|
||||
// DurationSecGT applies the GT predicate on the "durationSec" field.
|
||||
func DurationSecGT(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldGT(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// DurationSecGTE applies the GTE predicate on the "durationSec" field.
|
||||
func DurationSecGTE(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldGTE(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// DurationSecLT applies the LT predicate on the "durationSec" field.
|
||||
func DurationSecLT(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldLT(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// DurationSecLTE applies the LTE predicate on the "durationSec" field.
|
||||
func DurationSecLTE(v int) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldLTE(FieldDurationSec, v))
|
||||
}
|
||||
|
||||
// RemarkEQ applies the EQ predicate on the "remark" field.
|
||||
func RemarkEQ(v string) predicate.WorkpieceProcess {
|
||||
return predicate.WorkpieceProcess(sql.FieldEQ(FieldRemark, v))
|
||||
|
||||
@@ -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