This commit is contained in:
SunYF
2026-10-26 16:32:35 +08:00
parent 4b14f9540a
commit f86feb2271
99 changed files with 1652 additions and 521 deletions
+5
View File
@@ -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+" 中冻结,盘点期间禁止入库追加")