feat: 完成客户第12条需求+多系统改造
1. 新增预警表添加工单号字段,支持按工单号检索预警 2. 添加工单过滤在制品/绩效报表/预警中心查询 3. 补全WMS台账字段口径与权限配置 4. 修复备料单与数量不符处理流程 5. 新增配送进度/库位联动/自动出库功能 6. 修复AGV配送状态更新逻辑 7. 优化退料与库存管理细节
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"bj_power_wms/ent"
|
||||
"bj_power_wms/ent/inboundorder"
|
||||
"bj_power_wms/ent/inventory"
|
||||
"bj_power_wms/internal/svc"
|
||||
)
|
||||
|
||||
@@ -38,3 +39,49 @@ func lastInboundLocationHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// outboundLocationHintHandler 出库库位联动(客户诉求 一.9「出库相同」)。
|
||||
// 取值优先级:① 指定批次在库的实际四级库位(最准,出库就是从该货位取货)
|
||||
// ② 该物料最近一次入库的库位(历史常用库位)③ 均无则返回空,前端可继续走同区空位推荐。
|
||||
func outboundLocationHintHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
materialCode := strings.TrimSpace(r.URL.Query().Get("materialCode"))
|
||||
batchNo := strings.TrimSpace(r.URL.Query().Get("batchNo"))
|
||||
emptyHint := map[string]any{"zoneCode": "", "shelfNo": "", "layerNo": "", "positionNo": ""}
|
||||
if materialCode == "" && batchNo == "" {
|
||||
ok(w, emptyHint)
|
||||
return
|
||||
}
|
||||
if batchNo != "" {
|
||||
if b, err := ctx.EntClient.Inventory.Query().
|
||||
Where(inventory.ManageModeEQ(1), inventory.BatchNoEQ(batchNo)).
|
||||
Only(ctx0()); err == nil {
|
||||
ok(w, map[string]any{
|
||||
"zoneCode": b.ZoneCode,
|
||||
"shelfNo": b.ShelfNo,
|
||||
"layerNo": b.LayerNo,
|
||||
"positionNo": b.PositionNo,
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
if materialCode == "" {
|
||||
ok(w, emptyHint)
|
||||
return
|
||||
}
|
||||
ib, err := ctx.EntClient.InboundOrder.Query().
|
||||
Where(inboundorder.MaterialCodeEQ(materialCode)).
|
||||
Order(ent.Desc("created_at"), ent.Desc("id")).
|
||||
First(ctx0())
|
||||
if err != nil {
|
||||
ok(w, emptyHint)
|
||||
return
|
||||
}
|
||||
ok(w, map[string]any{
|
||||
"zoneCode": ib.ZoneCode,
|
||||
"shelfNo": ib.ShelfNo,
|
||||
"layerNo": ib.LayerNo,
|
||||
"positionNo": ib.PositionNo,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user