1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段 2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据 3. 重构日排产为工位产量分配模式,替代原接驳台列表 4. 新增备料单工位级字段与分批出库支持 5. 移除定时同步可生产数量,改为WMS实时拉取接口 6. 过滤操作日志,排除登录/退出相关日志 7. 调整仪表盘工序展示逻辑为今日派工路线 8. 新增接驳台维护菜单与基础数据
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/schema"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// StationProcess 工位↔工序 派工(当日/班次可换)
|
|
type StationProcess struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (StationProcess) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{entsql.Annotation{Table: "station_process"}}
|
|
}
|
|
|
|
func (StationProcess) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("id").Positive(),
|
|
field.Int("stationNo").Comment("工位号 1..12"),
|
|
field.Int("processCode").Comment("工序代码"),
|
|
field.String("effectDate").Default("").MaxLen(10).Comment("生效日期"),
|
|
field.String("shift").Default("").MaxLen(20).Comment("班次"),
|
|
field.String("operator").Default("").MaxLen(64),
|
|
field.Time("createdAt").Default(time.Now).Immutable(),
|
|
}
|
|
}
|
|
|
|
func (StationProcess) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("stationNo"),
|
|
index.Fields("effectDate"),
|
|
index.Fields("stationNo", "effectDate"),
|
|
// 同工位同天同班次唯一(派工覆盖式写入),防止备料算料翻倍
|
|
index.Fields("stationNo", "effectDate", "shift").Unique(),
|
|
}
|
|
}
|