feat: 来料检处置项实体与复检、日排产达成对比、PLC/WMS 传输日志
- WMS 新增「检验处置项」实体(schema + ent 生成码),配套检验记录实体调整与复检接口,完善来料检/不良退货/入库检验前端 - MES 日排产:新增达成率统计与计划对比逻辑,调整日排产前端与流程卡/工序流 - 日志与传输:MES 新增 PLC 日志与 WMS 客户端传输日志,WMS 新增 MES 客户端传输日志 - MES 其他:扫码、工单/工件、AGV 客户端与告警、产品导入等逻辑完善及前端调整 - 工位终端:上线面板/作业面板、工件 handler 与 MES 客户端调整 - 配置与文档:更新 mes-api.yaml、三端构建产物与问题记录文档
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"time"
|
||||
|
||||
"bj_power_mes/ent"
|
||||
"bj_power_mes/ent/dailyplan"
|
||||
"bj_power_mes/ent/flowmaterial"
|
||||
"bj_power_mes/ent/inspectionrecord"
|
||||
"bj_power_mes/ent/lossledger"
|
||||
@@ -600,27 +599,19 @@ func (s *Service) StationTask(ctx context.Context, stationNo int) (map[string]an
|
||||
if err != nil {
|
||||
return nil, errors.New("工位不存在或未配置")
|
||||
}
|
||||
// 工位终端可见工单 = 今日已启用排产(CONFIRMED/执行中)且工单已下发并开工(IN_PROGRESS)。
|
||||
// 与状态机对齐(方案 A):工单「下发并开工」=批准生产、排产启用=排进某一天;未开工或未排进今天的工单,终端一律不显示。
|
||||
// 工位终端可见工单(2026-11-16 死结7 定案):不限排产日期,所有进行中(IN_PROGRESS)工单,
|
||||
// 且工艺组合必须包含本工位——干不了的单不给选(此前整线单都可见,选了报工才被拒)。
|
||||
// 「昨天没干完的、想提前干明天的」都能选;PAUSED 暂停单不显示(恢复后可见)。
|
||||
orderNos := []string{}
|
||||
today := time.Now().Format("2006-01-02")
|
||||
plans, _ := s.ctx.EntClient.DailyPlan.Query().
|
||||
Where(dailyplan.PlanDate(today), dailyplan.StatusIn("CONFIRMED", "PROCESSING")).
|
||||
Order(ent.Asc(dailyplan.FieldID)).All(ctx)
|
||||
nos := make([]string, 0, len(plans))
|
||||
seen := map[string]bool{}
|
||||
for _, p := range plans {
|
||||
if !seen[p.OrderNo] {
|
||||
seen[p.OrderNo] = true
|
||||
nos = append(nos, p.OrderNo)
|
||||
}
|
||||
}
|
||||
if len(nos) > 0 {
|
||||
wos, _ := s.ctx.EntClient.WorkOrder.Query().
|
||||
Where(workorder.WorkOrderNoIn(nos...), workorder.StatusIn("IN_PROGRESS")).
|
||||
Order(ent.Asc(workorder.FieldID)).All(ctx)
|
||||
for _, w := range wos {
|
||||
orderNos = append(orderNos, w.WorkOrderNo)
|
||||
wos, _ := s.ctx.EntClient.WorkOrder.Query().
|
||||
Where(workorder.StatusIn("IN_PROGRESS")).
|
||||
Order(ent.Asc(workorder.FieldID)).All(ctx)
|
||||
for _, w := range wos {
|
||||
for _, item := range w.FlowCombination {
|
||||
if item["stationNo"] == stationNo {
|
||||
orderNos = append(orderNos, w.WorkOrderNo)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
// M4:工位终端按「本工位绑定的工艺流程」驱动。
|
||||
|
||||
Reference in New Issue
Block a user