refactor(mes): 移除工位接驳台绑定逻辑,改为独立dock主数据

- 移除station表的hasDock、dockCode字段及相关代码
- 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台
- 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式
- 新增SQL注释固化脚本,完善MES表注释
This commit is contained in:
SunYF
2026-10-08 13:09:53 +08:00
parent 7c7c16ee6d
commit 1f7a42fc38
132 changed files with 2799 additions and 1090 deletions
+5 -5
View File
@@ -9,8 +9,8 @@ import (
"bj_power_mes/ent"
"bj_power_mes/ent/alert"
dockent "bj_power_mes/ent/dock"
"bj_power_mes/ent/materialqtyreport"
"bj_power_mes/ent/station"
)
// ============ 数量不符(工位上报 → 处理闭环) ============
@@ -172,11 +172,11 @@ func (s *Service) HandleQtyReport(ctx context.Context, id int, handleType, note,
if rep.DiffQty <= 0 {
return nil, errors.New("本单为「多发」,不能走补发;请选择退库或调整")
}
// 目标接驳台:取该工位绑定的接驳台(无则空,由 WMS 侧按默认处理)
// 目标接驳台:取该工位关联的接驳台(一个工位可绑多个接驳台,取第一个;无则空,由 WMS 侧按默认处理)
dock := ""
if st, e := s.ctx.EntClient.Station.Query().
Where(station.StationNo(rep.StationNo)).Only(ctx); e == nil {
dock = st.DockCode
if dk, e := s.ctx.EntClient.Dock.Query().
Where(dockent.StationNo(rep.StationNo)).First(ctx); e == nil {
dock = dk.DockCode
}
reqNo := fmt.Sprintf("MR%d", time.Now().UnixNano())
create := s.ctx.EntClient.MaterialRequest.Create().