refactor: 重构产线工位与备料流程,移除冗余字段

1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段
2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据
3. 重构日排产为工位产量分配模式,替代原接驳台列表
4. 新增备料单工位级字段与分批出库支持
5. 移除定时同步可生产数量,改为WMS实时拉取接口
6. 过滤操作日志,排除登录/退出相关日志
7. 调整仪表盘工序展示逻辑为今日派工路线
8. 新增接驳台维护菜单与基础数据
This commit is contained in:
SunYF
2026-09-19 07:50:21 +08:00
parent 543655d441
commit 37f10d3a13
156 changed files with 4489 additions and 1285 deletions
+4 -19
View File
@@ -207,13 +207,14 @@ func buildCard(ctx context.Context, svcCtx *svc.ServiceContext, sn string) (*car
}
// hasTorqueStep 判断该工件加工路径上是否存在"拧紧采集"步骤(经 工位→流程→步骤 链)
// 路径由今日工位派工(station_process)派生
func hasTorqueStep(ctx context.Context, client *ent.Client, sn string, wp *ent.Workpiece) bool {
procCodes := parseCardSeq(wp.ProcessSeq)
if len(procCodes) == 0 {
route, err := logic.RouteStations(ctx, client, logic.TodayStr(), "")
if err != nil || len(route) == 0 {
return false
}
stations, err := client.Station.Query().
Where(station.StationNoIn(procCodes...), station.FlowIdGT(0)).All(ctx)
Where(station.StationNoIn(route...), station.FlowIdGT(0)).All(ctx)
if err != nil || len(stations) == 0 {
return false
}
@@ -229,22 +230,6 @@ func hasTorqueStep(ctx context.Context, client *ent.Client, sn string, wp *ent.W
return n > 0
}
// parseCardSeq 解析工单/工件工序组合 "1,3,5" → 工位号列表(含 0 号上线位)
func parseCardSeq(s string) []int {
out := []int{}
for _, p := range strings.Split(s, ",") {
p = strings.TrimSpace(p)
if p == "" {
continue
}
var n int
if _, err := fmt.Sscanf(p, "%d", &n); err == nil && n >= 0 && n <= logic.ProcessSeqMaxStation {
out = append(out, n)
}
}
return out
}
func itoaCard(n int) string { return fmt.Sprintf("%d", n) }
func renderProcessCard(t *cardTmpl) (string, error) {