Files
bj_power/bj_power_mes/ent/workpieceprocess/workpieceprocess.go
T
SunYF d609ff8a9e refactor: 重构工艺工序相关命名与数据模型
1.  全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2.  重构工单与工件工艺数据模型:
    - 新增工艺组合表flow_material作为备料/齐套唯一源头
    - 新增工位状态表station_state支持自主停单/恢复接单
    - 移除station_process派工表,改用工单工艺组合作为路线唯一源头
    - 替换processCode为flowId作为工艺关联标识
    - 重构工件当前进度字段为currentStationNo
3.  删除冗余的静态备份资源文件
4.  调整物料选择组件默认启用仅显示激活物料
5.  优化工单创建/编辑逻辑,新增工艺组合校验与保存
2026-09-22 11:32:29 +08:00

185 lines
6.9 KiB
Go

// Code generated by ent, DO NOT EDIT.
package workpieceprocess
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the workpieceprocess type in the database.
Label = "workpiece_process"
// 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"
// FieldFlowId holds the string denoting the flowid field in the database.
FieldFlowId = "flow_id"
// FieldStationNo holds the string denoting the stationno field in the database.
FieldStationNo = "station_no"
// FieldOrderNo holds the string denoting the orderno field in the database.
FieldOrderNo = "order_no"
// FieldProcessName holds the string denoting the processname field in the database.
FieldProcessName = "process_name"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldOperator holds the string denoting the operator field in the database.
FieldOperator = "operator"
// FieldResult holds the string denoting the result field in the database.
FieldResult = "result"
// FieldStartedAt holds the string denoting the startedat field in the database.
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.
FieldCreatedAt = "created_at"
// Table holds the table name of the workpieceprocess in the database.
Table = "workpiece_process"
)
// Columns holds all SQL columns for workpieceprocess fields.
var Columns = []string{
FieldID,
FieldSn,
FieldFlowId,
FieldStationNo,
FieldOrderNo,
FieldProcessName,
FieldStatus,
FieldOperator,
FieldResult,
FieldStartedAt,
FieldEndedAt,
FieldDurationSec,
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
// DefaultStationNo holds the default value on creation for the "stationNo" field.
DefaultStationNo string
// StationNoValidator is a validator for the "stationNo" field. It is called by the builders before save.
StationNoValidator func(string) error
// DefaultOrderNo holds the default value on creation for the "orderNo" field.
DefaultOrderNo string
// OrderNoValidator is a validator for the "orderNo" field. It is called by the builders before save.
OrderNoValidator func(string) error
// DefaultProcessName holds the default value on creation for the "processName" field.
DefaultProcessName string
// ProcessNameValidator is a validator for the "processName" field. It is called by the builders before save.
ProcessNameValidator 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.
StatusValidator 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
// DefaultResult holds the default value on creation for the "result" field.
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.
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 WorkpieceProcess 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()
}
// ByFlowId orders the results by the flowId field.
func ByFlowId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlowId, opts...).ToFunc()
}
// ByStationNo orders the results by the stationNo field.
func ByStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStationNo, opts...).ToFunc()
}
// ByOrderNo orders the results by the orderNo field.
func ByOrderNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderNo, opts...).ToFunc()
}
// ByProcessName orders the results by the processName field.
func ByProcessName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProcessName, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByOperator orders the results by the operator field.
func ByOperator(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOperator, opts...).ToFunc()
}
// ByResult orders the results by the result field.
func ByResult(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResult, opts...).ToFunc()
}
// ByStartedAt orders the results by the startedAt field.
func ByStartedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStartedAt, opts...).ToFunc()
}
// ByEndedAt orders the results by the endedAt field.
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()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}