feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -31,6 +31,12 @@ const (
|
||||
FieldQualityStatus = "quality_status"
|
||||
// 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"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldProductionDate holds the string denoting the production_date field in the database.
|
||||
@@ -43,6 +49,22 @@ const (
|
||||
FieldOrderNo = "order_no"
|
||||
// FieldCompletedProcess holds the string denoting the completed_process field in the database.
|
||||
FieldCompletedProcess = "completed_process"
|
||||
// FieldOwnershipType holds the string denoting the ownership_type field in the database.
|
||||
FieldOwnershipType = "ownership_type"
|
||||
// FieldOwnershipNo holds the string denoting the ownership_no field in the database.
|
||||
FieldOwnershipNo = "ownership_no"
|
||||
// FieldProductStatus holds the string denoting the product_status field in the database.
|
||||
FieldProductStatus = "product_status"
|
||||
// FieldRelatedStandard holds the string denoting the related_standard field in the database.
|
||||
FieldRelatedStandard = "related_standard"
|
||||
// FieldTestRecordNo holds the string denoting the test_record_no field in the database.
|
||||
FieldTestRecordNo = "test_record_no"
|
||||
// FieldRecordedBy holds the string denoting the recorded_by field in the database.
|
||||
FieldRecordedBy = "recorded_by"
|
||||
// FieldRecordedAt holds the string denoting the recorded_at field in the database.
|
||||
FieldRecordedAt = "recorded_at"
|
||||
// FieldOutboundReason holds the string denoting the outbound_reason field in the database.
|
||||
FieldOutboundReason = "outbound_reason"
|
||||
// FieldRemark holds the string denoting the remark field in the database.
|
||||
FieldRemark = "remark"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
@@ -66,12 +88,23 @@ var Columns = []string{
|
||||
FieldLockedQty,
|
||||
FieldQualityStatus,
|
||||
FieldZoneCode,
|
||||
FieldShelfNo,
|
||||
FieldLayerNo,
|
||||
FieldPositionNo,
|
||||
FieldStatus,
|
||||
FieldProductionDate,
|
||||
FieldSupplier,
|
||||
FieldInboundNo,
|
||||
FieldOrderNo,
|
||||
FieldCompletedProcess,
|
||||
FieldOwnershipType,
|
||||
FieldOwnershipNo,
|
||||
FieldProductStatus,
|
||||
FieldRelatedStandard,
|
||||
FieldTestRecordNo,
|
||||
FieldRecordedBy,
|
||||
FieldRecordedAt,
|
||||
FieldOutboundReason,
|
||||
FieldRemark,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
@@ -170,6 +203,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()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
@@ -200,6 +248,46 @@ func ByCompletedProcess(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCompletedProcess, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOwnershipType orders the results by the ownership_type field.
|
||||
func ByOwnershipType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOwnershipType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOwnershipNo orders the results by the ownership_no field.
|
||||
func ByOwnershipNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOwnershipNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByProductStatus orders the results by the product_status field.
|
||||
func ByProductStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldProductStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRelatedStandard orders the results by the related_standard field.
|
||||
func ByRelatedStandard(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRelatedStandard, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTestRecordNo orders the results by the test_record_no field.
|
||||
func ByTestRecordNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTestRecordNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRecordedBy orders the results by the recorded_by field.
|
||||
func ByRecordedBy(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRecordedBy, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByRecordedAt orders the results by the recorded_at field.
|
||||
func ByRecordedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldRecordedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOutboundReason orders the results by the outbound_reason field.
|
||||
func ByOutboundReason(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOutboundReason, 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