feat: 新增工件生命周期状态流水表及工单状态流转逻辑

新增工件生命周期状态流水表,记录所有工件状态变更动作,替代原半成品质检计数源
调整工单状态流转,将「下发工单」与「开始执行」合并为「下发并开工」,自动启用关联排产
新增工件物理位置字段,区分业务位置与实际物理工位,解决工位对账滞后问题
统一物料类别处理,避免 WMS 同步时覆盖合法值或错误设置为 0
移除已废弃的返修状态,更新相关显示与逻辑
This commit is contained in:
weixiao_world@163.com
2026-10-12 22:32:55 +08:00
parent 6c181b9242
commit 72374f80cb
52 changed files with 5463 additions and 320 deletions
+3 -3
View File
@@ -483,8 +483,8 @@ func (s *Service) StationTask(ctx context.Context, stationNo int) (map[string]an
if err != nil {
return nil, errors.New("工位不存在或未配置")
}
// 工位终端可见工单 = 今日已启用排产(CONFIRMED/执行中)且工单已下发/在制(RELEASED/IN_PROGRESS)。
// 与状态机对齐:工单下发=批准生产、排产启用=排进某一天;未下发或未排进今天的工单,终端一律不显示。
// 工位终端可见工单 = 今日已启用排产(CONFIRMED/执行中)且工单已下发并开工(IN_PROGRESS)。
// 与状态机对齐(方案 A):工单「下发并开工」=批准生产、排产启用=排进某一天;未开工或未排进今天的工单,终端一律不显示。
orderNos := []string{}
today := time.Now().Format("2006-01-02")
plans, _ := s.ctx.EntClient.DailyPlan.Query().
@@ -500,7 +500,7 @@ func (s *Service) StationTask(ctx context.Context, stationNo int) (map[string]an
}
if len(nos) > 0 {
wos, _ := s.ctx.EntClient.WorkOrder.Query().
Where(workorder.WorkOrderNoIn(nos...), workorder.StatusIn("RELEASED", "IN_PROGRESS")).
Where(workorder.WorkOrderNoIn(nos...), workorder.StatusIn("IN_PROGRESS")).
Order(ent.Asc(workorder.FieldID)).All(ctx)
for _, w := range wos {
orderNos = append(orderNos, w.WorkOrderNo)