提交
This commit is contained in:
@@ -330,9 +330,14 @@ func createInboundHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
|
||||
// 同批次追加(多批到货追加)
|
||||
// 批次号唯一性以「物料+批次」为准:同号不同料 = 占用冲突(防跨物料串批)
|
||||
existing, e := tx.Inventory.Query().
|
||||
Where(inventory.SnModeEQ(snModeBatch), inventory.BatchNoEQ(batchNo)).Only(ctx0())
|
||||
if e == nil {
|
||||
if existing.MaterialCode != req.MaterialCode {
|
||||
fail(w, http.StatusConflict, "批次号 "+batchNo+" 已被物料 "+existing.MaterialCode+" 占用,请换批次号")
|
||||
return
|
||||
}
|
||||
// 盘点冻结守卫(问题2):盘点期间库存量冻结,禁止向已锁定批次追加入库。
|
||||
if existing.StocktakeNo != "" {
|
||||
fail(w, http.StatusConflict, "批次 "+batchNo+" 正在盘点单 "+existing.StocktakeNo+" 中冻结,盘点期间禁止入库追加")
|
||||
|
||||
Reference in New Issue
Block a user