feat: 重构入库流程,支持序列号与类型解耦,新增通用入库组件
- 重构物料档案字段:将"序列号件"改为"序列号",描述是否有序列号,与类型独立 - 调整入库页逻辑:按物料"序列号"决定记账方式,类型仅用于页签归属 - 新增通用入库组件 InboundEntry,复用三个类型页签的表单逻辑 - 优化成品入库页面,提交后自动切换到入库列表页签 - 修正物料校验提示文案,统一表述为"是否有序列号"
This commit is contained in:
@@ -11,9 +11,9 @@ import (
|
||||
"time"
|
||||
|
||||
"bj_power_mes/ent"
|
||||
"bj_power_mes/ent/dock"
|
||||
"bj_power_mes/ent/flowmaterial"
|
||||
"bj_power_mes/ent/materialrequest"
|
||||
"bj_power_mes/ent/station"
|
||||
"bj_power_mes/ent/workorder"
|
||||
"bj_power_mes/internal/wmsclient"
|
||||
)
|
||||
@@ -114,12 +114,16 @@ func (s *Service) GenerateMaterialRequest(ctx context.Context, planDate string,
|
||||
for _, it := range g.items {
|
||||
stationsByFlow[it.FlowId] = append(stationsByFlow[it.FlowId], it.StationNo)
|
||||
}
|
||||
// 工位号 → 接驳台编码
|
||||
// 工位号 → 默认接驳台编码:真源 = dock 表(一工位可绑 R1/R2 多个接驳台,按编码升序取第一个为默认)
|
||||
dockByStation := map[int]string{}
|
||||
if sts, e := s.ctx.EntClient.Station.Query().
|
||||
Where(station.StationNoIn(RouteStationsOfWO(g.items)...)).All(ctx); e == nil {
|
||||
for _, st := range sts {
|
||||
dockByStation[st.StationNo] = st.DockCode
|
||||
if dks, e := s.ctx.EntClient.Dock.Query().
|
||||
Where(dock.StationNoIn(RouteStationsOfWO(g.items)...), dock.DockTypeEQ("line")).
|
||||
Order(ent.Asc(dock.FieldStationNo), ent.Asc(dock.FieldDockCode)).
|
||||
All(ctx); e == nil {
|
||||
for _, d := range dks {
|
||||
if _, ok := dockByStation[d.StationNo]; !ok && d.DockCode != "" {
|
||||
dockByStation[d.StationNo] = d.DockCode
|
||||
}
|
||||
}
|
||||
}
|
||||
for flowId, stations := range stationsByFlow {
|
||||
|
||||
Reference in New Issue
Block a user