feat: 新增工件生命周期状态流水表及工单状态流转逻辑

新增工件生命周期状态流水表,记录所有工件状态变更动作,替代原半成品质检计数源
调整工单状态流转,将「下发工单」与「开始执行」合并为「下发并开工」,自动启用关联排产
新增工件物理位置字段,区分业务位置与实际物理工位,解决工位对账滞后问题
统一物料类别处理,避免 WMS 同步时覆盖合法值或错误设置为 0
移除已废弃的返修状态,更新相关显示与逻辑
This commit is contained in:
weixiao_world@163.com
2026-10-12 22:32:55 +08:00
parent 6c181b9242
commit 72374f80cb
52 changed files with 5463 additions and 320 deletions
+55
View File
@@ -74,6 +74,11 @@ func CurrentStationNo(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldEQ(FieldCurrentStationNo, v))
}
// AtStationNo applies equality check predicate on the "atStationNo" field. It's identical to AtStationNoEQ.
func AtStationNo(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldEQ(FieldAtStationNo, v))
}
// Status applies equality check predicate on the "status" field. It's identical to StatusEQ.
func Status(v string) predicate.Workpiece {
return predicate.Workpiece(sql.FieldEQ(FieldStatus, v))
@@ -329,6 +334,56 @@ func CurrentStationNoNotNil() predicate.Workpiece {
return predicate.Workpiece(sql.FieldNotNull(FieldCurrentStationNo))
}
// AtStationNoEQ applies the EQ predicate on the "atStationNo" field.
func AtStationNoEQ(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldEQ(FieldAtStationNo, v))
}
// AtStationNoNEQ applies the NEQ predicate on the "atStationNo" field.
func AtStationNoNEQ(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldNEQ(FieldAtStationNo, v))
}
// AtStationNoIn applies the In predicate on the "atStationNo" field.
func AtStationNoIn(vs ...int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldIn(FieldAtStationNo, vs...))
}
// AtStationNoNotIn applies the NotIn predicate on the "atStationNo" field.
func AtStationNoNotIn(vs ...int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldNotIn(FieldAtStationNo, vs...))
}
// AtStationNoGT applies the GT predicate on the "atStationNo" field.
func AtStationNoGT(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldGT(FieldAtStationNo, v))
}
// AtStationNoGTE applies the GTE predicate on the "atStationNo" field.
func AtStationNoGTE(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldGTE(FieldAtStationNo, v))
}
// AtStationNoLT applies the LT predicate on the "atStationNo" field.
func AtStationNoLT(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldLT(FieldAtStationNo, v))
}
// AtStationNoLTE applies the LTE predicate on the "atStationNo" field.
func AtStationNoLTE(v int) predicate.Workpiece {
return predicate.Workpiece(sql.FieldLTE(FieldAtStationNo, v))
}
// AtStationNoIsNil applies the IsNil predicate on the "atStationNo" field.
func AtStationNoIsNil() predicate.Workpiece {
return predicate.Workpiece(sql.FieldIsNull(FieldAtStationNo))
}
// AtStationNoNotNil applies the NotNil predicate on the "atStationNo" field.
func AtStationNoNotNil() predicate.Workpiece {
return predicate.Workpiece(sql.FieldNotNull(FieldAtStationNo))
}
// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v string) predicate.Workpiece {
return predicate.Workpiece(sql.FieldEQ(FieldStatus, v))
+8
View File
@@ -21,6 +21,8 @@ const (
FieldWorkOrderId = "work_order_id"
// FieldCurrentStationNo holds the string denoting the currentstationno field in the database.
FieldCurrentStationNo = "current_station_no"
// FieldAtStationNo holds the string denoting the atstationno field in the database.
FieldAtStationNo = "at_station_no"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldOnlineAt holds the string denoting the onlineat field in the database.
@@ -42,6 +44,7 @@ var Columns = []string{
FieldOrderNo,
FieldWorkOrderId,
FieldCurrentStationNo,
FieldAtStationNo,
FieldStatus,
FieldOnlineAt,
FieldDoneAt,
@@ -108,6 +111,11 @@ func ByCurrentStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCurrentStationNo, opts...).ToFunc()
}
// ByAtStationNo orders the results by the atStationNo field.
func ByAtStationNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAtStationNo, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()