feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段

- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统
- 为BomItem实体添加relatedStandard字段及相关CRUD方法
- 为InspectionRecord实体添加reportNo、materialCode、materialName等字段
- 更新ent schema确保新字段的验证和默认值设置
- 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
SunYF
2026-09-17 12:49:07 +08:00
parent b4b274301d
commit 1cc93795ce
191 changed files with 24504 additions and 1250 deletions
+125
View File
@@ -109,6 +109,16 @@ func ProductSerial(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldProductSerial, v))
}
// CreatedBy applies equality check predicate on the "createdBy" field. It's identical to CreatedByEQ.
func CreatedBy(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldCreatedBy, v))
}
// DueDate applies equality check predicate on the "dueDate" field. It's identical to DueDateEQ.
func DueDate(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldDueDate, v))
}
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
func Status(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldStatus, v))
@@ -754,6 +764,121 @@ func ProductSerialContainsFold(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldContainsFold(FieldProductSerial, v))
}
// CreatedByEQ applies the EQ predicate on the "createdBy" field.
func CreatedByEQ(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldCreatedBy, v))
}
// CreatedByNEQ applies the NEQ predicate on the "createdBy" field.
func CreatedByNEQ(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldNEQ(FieldCreatedBy, v))
}
// CreatedByIn applies the In predicate on the "createdBy" field.
func CreatedByIn(vs ...string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldIn(FieldCreatedBy, vs...))
}
// CreatedByNotIn applies the NotIn predicate on the "createdBy" field.
func CreatedByNotIn(vs ...string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldNotIn(FieldCreatedBy, vs...))
}
// CreatedByGT applies the GT predicate on the "createdBy" field.
func CreatedByGT(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldGT(FieldCreatedBy, v))
}
// CreatedByGTE applies the GTE predicate on the "createdBy" field.
func CreatedByGTE(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldGTE(FieldCreatedBy, v))
}
// CreatedByLT applies the LT predicate on the "createdBy" field.
func CreatedByLT(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldLT(FieldCreatedBy, v))
}
// CreatedByLTE applies the LTE predicate on the "createdBy" field.
func CreatedByLTE(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldLTE(FieldCreatedBy, v))
}
// CreatedByContains applies the Contains predicate on the "createdBy" field.
func CreatedByContains(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldContains(FieldCreatedBy, v))
}
// CreatedByHasPrefix applies the HasPrefix predicate on the "createdBy" field.
func CreatedByHasPrefix(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldHasPrefix(FieldCreatedBy, v))
}
// CreatedByHasSuffix applies the HasSuffix predicate on the "createdBy" field.
func CreatedByHasSuffix(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldHasSuffix(FieldCreatedBy, v))
}
// CreatedByEqualFold applies the EqualFold predicate on the "createdBy" field.
func CreatedByEqualFold(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEqualFold(FieldCreatedBy, v))
}
// CreatedByContainsFold applies the ContainsFold predicate on the "createdBy" field.
func CreatedByContainsFold(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldContainsFold(FieldCreatedBy, v))
}
// DueDateEQ applies the EQ predicate on the "dueDate" field.
func DueDateEQ(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldDueDate, v))
}
// DueDateNEQ applies the NEQ predicate on the "dueDate" field.
func DueDateNEQ(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldNEQ(FieldDueDate, v))
}
// DueDateIn applies the In predicate on the "dueDate" field.
func DueDateIn(vs ...time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldIn(FieldDueDate, vs...))
}
// DueDateNotIn applies the NotIn predicate on the "dueDate" field.
func DueDateNotIn(vs ...time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldNotIn(FieldDueDate, vs...))
}
// DueDateGT applies the GT predicate on the "dueDate" field.
func DueDateGT(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldGT(FieldDueDate, v))
}
// DueDateGTE applies the GTE predicate on the "dueDate" field.
func DueDateGTE(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldGTE(FieldDueDate, v))
}
// DueDateLT applies the LT predicate on the "dueDate" field.
func DueDateLT(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldLT(FieldDueDate, v))
}
// DueDateLTE applies the LTE predicate on the "dueDate" field.
func DueDateLTE(v time.Time) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldLTE(FieldDueDate, v))
}
// DueDateIsNil applies the IsNil predicate on the "dueDate" field.
func DueDateIsNil() predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldIsNull(FieldDueDate))
}
// DueDateNotNil applies the NotNil predicate on the "dueDate" field.
func DueDateNotNil() predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldNotNull(FieldDueDate))
}
// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v string) predicate.WorkOrder {
return predicate.WorkOrder(sql.FieldEQ(FieldStatus, v))
+20
View File
@@ -35,6 +35,10 @@ const (
FieldProjectNo = "project_no"
// FieldProductSerial holds the string denoting the productserial field in the database.
FieldProductSerial = "product_serial"
// FieldCreatedBy holds the string denoting the createdby field in the database.
FieldCreatedBy = "created_by"
// FieldDueDate holds the string denoting the duedate field in the database.
FieldDueDate = "due_date"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldPlanStart holds the string denoting the planstart field in the database.
@@ -67,6 +71,8 @@ var Columns = []string{
FieldContractNo,
FieldProjectNo,
FieldProductSerial,
FieldCreatedBy,
FieldDueDate,
FieldStatus,
FieldPlanStart,
FieldPlanEnd,
@@ -119,6 +125,10 @@ var (
DefaultProductSerial string
// ProductSerialValidator is a validator for the "productSerial" field. It is called by the builders before save.
ProductSerialValidator func(string) error
// DefaultCreatedBy holds the default value on creation for the "createdBy" field.
DefaultCreatedBy string
// CreatedByValidator is a validator for the "createdBy" field. It is called by the builders before save.
CreatedByValidator func(string) error
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus string
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
@@ -196,6 +206,16 @@ func ByProductSerial(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProductSerial, opts...).ToFunc()
}
// ByCreatedBy orders the results by the createdBy field.
func ByCreatedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedBy, opts...).ToFunc()
}
// ByDueDate orders the results by the dueDate field.
func ByDueDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDueDate, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()