feat: 完成客户第12条需求+多系统改造

1. 新增预警表添加工单号字段,支持按工单号检索预警
2. 添加工单过滤在制品/绩效报表/预警中心查询
3. 补全WMS台账字段口径与权限配置
4. 修复备料单与数量不符处理流程
5. 新增配送进度/库位联动/自动出库功能
6. 修复AGV配送状态更新逻辑
7. 优化退料与库存管理细节
This commit is contained in:
SunYF
2026-09-19 17:04:58 +08:00
parent 62e45b7379
commit 05b0b8a909
89 changed files with 7912 additions and 429 deletions
+7 -1
View File
@@ -14,6 +14,7 @@ import (
"bj_power_mes/ent/stepcriterion"
"bj_power_mes/ent/torqueauditlog"
"bj_power_mes/ent/torquerecord"
"bj_power_mes/ent/workpiece"
"bj_power_mes/ent/workpieceprocess"
)
@@ -89,7 +90,12 @@ func (s *Service) evaluateTorqueCriterion(ctx context.Context, sn, stationNo str
}
}
if ng {
s.Evaluate(ctx, "torque_ng", 1, "拧紧扭矩不合格", "SN="+sn+" 工位"+stationNo, "torque_record", sn)
// 反查该 SN 所属工单号一并写入预警,供预警中心按工单号检索(客户第12条)
orderNo := ""
if wp, e := s.ctx.EntClient.Workpiece.Query().Where(workpiece.Sn(sn)).First(ctx); e == nil {
orderNo = wp.OrderNo
}
s.Evaluate(ctx, "torque_ng", 1, "拧紧扭矩不合格", "SN="+sn+" 工位"+stationNo, "torque_record", sn, orderNo)
}
}