feat: 两库对等物料管理及产品工号贯通全流程
- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步 - 全流程新增产品工号字段,贯通入库/库存/出库/检验环节 - 工单管理支持多工单混产,移除单工单互斥限制 - 新增批次号/SN 字段支持质量检验联动 WMS 库存处置 - 修复权限规则,仅内置管理员账号不允许修改删除 - 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
@@ -111,19 +111,6 @@ func (s *Service) buildWorkOrderProgress(ctx context.Context, today time.Time) [
|
||||
return []WorkOrderProgress{}
|
||||
}
|
||||
date := today.Format("2006-01-02")
|
||||
// 当前产线工艺组合(唯一路线源头 = 工单 flow_combination):取执行中工单,无则取最新已下发工单
|
||||
routeStr := ""
|
||||
if cur, err := s.ctx.EntClient.WorkOrder.Query().
|
||||
Where(workorder.Status("IN_PROGRESS")).Order(ent.Desc(workorder.FieldID)).First(ctx); err == nil {
|
||||
if items, _ := RouteStationsFromWO(ctx, s.ctx.EntClient, cur); len(items) > 0 {
|
||||
routeStr = RouteStationsStrOfWO(items)
|
||||
}
|
||||
} else if rel, err := s.ctx.EntClient.WorkOrder.Query().
|
||||
Where(workorder.Status("RELEASED")).Order(ent.Desc(workorder.FieldID)).First(ctx); err == nil {
|
||||
if items, _ := RouteStationsFromWO(ctx, s.ctx.EntClient, rel); len(items) > 0 {
|
||||
routeStr = RouteStationsStrOfWO(items)
|
||||
}
|
||||
}
|
||||
list := make([]WorkOrderProgress, 0, len(wos))
|
||||
for _, w := range wos {
|
||||
item := WorkOrderProgress{
|
||||
@@ -139,7 +126,12 @@ func (s *Service) buildWorkOrderProgress(ctx context.Context, today time.Time) [
|
||||
DailyPlanQty: s.sumDailyPlanQtyByOrder(ctx, date, w.WorkOrderNo),
|
||||
DailyDoneQty: s.countWorkpieceDoneByOrder(ctx, today, w.WorkOrderNo),
|
||||
}
|
||||
item.CurrentProcess = "工艺组合 " + routeStr
|
||||
// 多工单混生产:每单显示自己的工艺组合路线(唯一路线源头=本工单 flow_combination),不再共用单一在产工单路线
|
||||
if items, _ := RouteStationsFromWO(ctx, s.ctx.EntClient, w); len(items) > 0 {
|
||||
item.CurrentProcess = "工艺组合 " + RouteStationsStrOfWO(items)
|
||||
} else {
|
||||
item.CurrentProcess = "工艺组合 未配置"
|
||||
}
|
||||
list = append(list, item)
|
||||
}
|
||||
// 进行中的工单排前面,同状态按 ID 倒序
|
||||
|
||||
Reference in New Issue
Block a user