feat: 新增 AgvPoint 点位表及客户端,支持点位编码与接驳台绑定
This commit is contained in:
@@ -348,6 +348,8 @@ func makeOutboundHandler(ctx *svc.ServiceContext, outboundType string) http.Hand
|
||||
fail(w, http.StatusConflict, "批次扣减失败(库存不足或并发冲突): "+req.BatchNo)
|
||||
return
|
||||
}
|
||||
// 同步核销本批次的 ACTIVE 锁记录(FIFO 递减,扣到 0 置 CONSUMED),消除残留锁
|
||||
consumeLocksForBatch(tx, req.BatchNo, req.MaterialCode, min(actualQty, b.LockedQty))
|
||||
if _, err = tx.OutboundDetail.Create().
|
||||
SetOutboundNo(outboundNo).
|
||||
SetBatchNo(req.BatchNo).
|
||||
@@ -402,6 +404,8 @@ func makeOutboundHandler(ctx *svc.ServiceContext, outboundType string) http.Hand
|
||||
fail(w, http.StatusBadRequest, "SN 不可出库(非在库/锁定): "+sn)
|
||||
return
|
||||
}
|
||||
// 同步核销该 SN 的 ACTIVE 锁记录,消除残留锁
|
||||
consumeLocksForSN(tx, []string{sn})
|
||||
if _, err = tx.OutboundDetail.Create().
|
||||
SetOutboundNo(outboundNo).
|
||||
SetSnCode(sn).
|
||||
|
||||
Reference in New Issue
Block a user