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
@@ -21,6 +21,7 @@ import (
"bj_power_mes/ent/stepcriterion"
"bj_power_mes/ent/workorder"
"bj_power_mes/ent/workpieceprocess"
"bj_power_mes/internal/logic"
"bj_power_mes/internal/svc"
)
@@ -157,8 +158,7 @@ func buildModelCard(ctx context.Context, svcCtx *svc.ServiceContext, productType
return nil, fmt.Errorf("产品型号不存在")
}
// 2) 工位组合:优先取该产品最近一张工单的工位组合;无工单则取全产线工位(升序
seq := []int{}
// 2) 产品最近工单(仅取工单号/计划时间用于卡头展示;路线不再存工单
if productCode != "" {
if wo, err := client.WorkOrder.Query().
Where(workorder.ProductCode(productCode)).
@@ -170,16 +170,19 @@ func buildModelCard(ctx context.Context, svcCtx *svc.ServiceContext, productType
if wo.PlanEnd != nil {
card.PlanEnd = wo.PlanEnd.Format("2006-01-02 15:04")
}
seq = parseCardSeq(wo.ProcessSeq)
card.SeqSource = "取自工单 " + wo.WorkOrderNo
}
}
// 3) 工位组合:由「今日工位派工(station_process)」派生;未派工则展示全产线已配置工艺流的工位
seq, _ := logic.RouteStations(ctx, client, logic.TodayStr(), "")
if len(seq) == 0 {
sts, _ := client.Station.Query().Order(ent.Asc(station.FieldStationNo)).All(ctx)
sts, _ := client.Station.Query().Where(station.FlowIdGT(0)).Order(ent.Asc(station.FieldStationNo)).All(ctx)
for _, st := range sts {
seq = append(seq, st.StationNo)
}
card.SeqSource = "该型号暂无工单,按全产线工位顺序展示"
card.SeqSource = "今日未派工,按全产线已配置工位顺序展示"
} else {
card.SeqSource = "取自今日工位派工路线"
}
sort.Ints(seq)
card.ProcessSeq = joinInts(seq)