Files
weixiao_world@163.com 72374f80cb feat: 新增工件生命周期状态流水表及工单状态流转逻辑
新增工件生命周期状态流水表,记录所有工件状态变更动作,替代原半成品质检计数源
调整工单状态流转,将「下发工单」与「开始执行」合并为「下发并开工」,自动启用关联排产
新增工件物理位置字段,区分业务位置与实际物理工位,解决工位对账滞后问题
统一物料类别处理,避免 WMS 同步时覆盖合法值或错误设置为 0
移除已废弃的返修状态,更新相关显示与逻辑
2026-10-12 22:32:55 +08:00

165 lines
6.2 KiB
Go

// Code generated by ent, DO NOT EDIT.
package workpiecelifecyclelog
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the workpiecelifecyclelog type in the database.
Label = "workpiece_lifecycle_log"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldSn holds the string denoting the sn field in the database.
FieldSn = "sn"
// FieldWorkOrderNo holds the string denoting the workorderno field in the database.
FieldWorkOrderNo = "work_order_no"
// FieldAction holds the string denoting the action field in the database.
FieldAction = "action"
// FieldFromStatus holds the string denoting the fromstatus field in the database.
FieldFromStatus = "from_status"
// FieldToStatus holds the string denoting the tostatus field in the database.
FieldToStatus = "to_status"
// FieldStationNo holds the string denoting the stationno field in the database.
FieldStationNo = "station_no"
// FieldFlowSeq holds the string denoting the flowseq field in the database.
FieldFlowSeq = "flow_seq"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldSource holds the string denoting the source field in the database.
FieldSource = "source"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the workpiecelifecyclelog in the database.
Table = "workpiece_lifecycle_log"
)
// Columns holds all SQL columns for workpiecelifecyclelog fields.
var Columns = []string{
FieldID,
FieldSn,
FieldWorkOrderNo,
FieldAction,
FieldFromStatus,
FieldToStatus,
FieldStationNo,
FieldFlowSeq,
FieldOperator,
FieldSource,
FieldRemark,
FieldCreatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// SnValidator is a validator for the "sn" field. It is called by the builders before save.
SnValidator func(string) error
// DefaultWorkOrderNo holds the default value on creation for the "workOrderNo" field.
DefaultWorkOrderNo string
// WorkOrderNoValidator is a validator for the "workOrderNo" field. It is called by the builders before save.
WorkOrderNoValidator func(string) error
// ActionValidator is a validator for the "action" field. It is called by the builders before save.
ActionValidator func(string) error
// DefaultFromStatus holds the default value on creation for the "fromStatus" field.
DefaultFromStatus string
// FromStatusValidator is a validator for the "fromStatus" field. It is called by the builders before save.
FromStatusValidator func(string) error
// DefaultToStatus holds the default value on creation for the "toStatus" field.
DefaultToStatus string
// ToStatusValidator is a validator for the "toStatus" field. It is called by the builders before save.
ToStatusValidator func(string) error
// DefaultOperator holds the default value on creation for the "operator" field.
DefaultOperator string
// OperatorValidator is a validator for the "operator" field. It is called by the builders before save.
OperatorValidator func(string) error
// DefaultSource holds the default value on creation for the "source" field.
DefaultSource string
// SourceValidator is a validator for the "source" field. It is called by the builders before save.
SourceValidator func(string) error
// 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.
RemarkValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
DefaultCreatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
IDValidator func(int) error
)
// OrderOption defines the ordering options for the WorkpieceLifecycleLog queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// BySn orders the results by the sn field.
func BySn(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSn, opts...).ToFunc()
}
// ByWorkOrderNo orders the results by the workOrderNo field.
func ByWorkOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldWorkOrderNo, opts...).ToFunc()
}
// ByAction orders the results by the action field.
func ByAction(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAction, opts...).ToFunc()
}
// ByFromStatus orders the results by the fromStatus field.
func ByFromStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFromStatus, opts...).ToFunc()
}
// ByToStatus orders the results by the toStatus field.
func ByToStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldToStatus, opts...).ToFunc()
}
// ByStationNo orders the results by the stationNo field.
func ByStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStationNo, opts...).ToFunc()
}
// ByFlowSeq orders the results by the flowSeq field.
func ByFlowSeq(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlowSeq, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// BySource orders the results by the source field.
func BySource(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSource, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}