# 物料入库后通过接口备料显示库存被占用或库存不足

**URL:** <https://group.xinheyun.com/t/topic/810>\
**Category:** 质量域\
**Tags:** bug单\
**Created:** [2026 年3 月 20 日 06:00 UTC](https://group.xinheyun.com/t/topic/810 "2026-03-20T06:00:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

作者： ![15801731779](https://avatars.discourse-cdn.com/v4/letter/1/6de8d8/32.png) [@15801731779](https://group.xinheyun.com/u/15801731779)\
发布日期： [2026 年3 月 20 日 06:00 UTC](https://group.xinheyun.com/t/topic/810/1 "2026-03-20T06:00:06Z")

</div>

入库接口：[https://c2.xinheyun.com/api/open/v4/inventory/task/productionIn/confirm](https://c2.xinheyun.com/api/open/v4/inventory/task/productionIn/confirm)  
参数：{“body”:{“id”:“42276945”,“records”:[{“quantity”:1,“warehouseCode”:“通用仓库”,“batchCode”:“2026-03-20-2160300000011”,“snCode”:“U725ZD107319\_260319A034\_1 +0.33\_2 +0.31\_3 -0.26\_4 -0.14\_5 -0.34\_6 +0.14\_7 +0.49\_8 +0.49\_9 -0.26\_ 10 +0.15”}]}}  
结果：{“code”:200,“message”:“成功”}  
备料接口：[https://c2.xinheyun.com/api/open/v2/inventory/task/materialTask/confirm/v2](https://c2.xinheyun.com/api/open/v2/inventory/task/materialTask/confirm/v2)  
参数：{“body”:{“type”:1,“records”:[{“batchNumber”:“2026-03-20-2160300000011”,“itemCode”:“2160300000011”,“quantity”:1.00000000,“snNumber”:“U725ZD107319\_260319A034\_1 +0.33\_2 +0.31\_3 -0.26\_4 -0.14\_5 -0.34\_6 +0.14\_7 +0.49\_8 +0.49\_9 -0.26\_ 10 +0.15”,“warehouseCode”:“通用仓库”,“workOrderCode”:“MOLC06260312003”}]}}  
结果：{“code”:403,“message”:“物料任务确认失败:2160300000011库存数不足或被占用，无法操作[BaseResultMsgDTO(uniqueKey=7385974886176735233-0, errorMsg=2160300000011库存数不足或被占用，无法操作, errorCode=0, extendErrorInfo=null)]”}

---

<div class="post-metadata">

作者： ![pan.kai](https://yyz1.discourse-cdn.com/flex011/user_avatar/group.xinheyun.com/pan.kai/32/23_2.png) [@pan.kai](https://group.xinheyun.com/u/pan.kai)\
发布日期： [2026 年3 月 31 日 03:34 UTC](https://group.xinheyun.com/t/topic/810/2 "2026-03-31T03:34:24Z")

</div>

需要检查对应批次下的SN库存的当前状态，这个提示一般是指当前状态不允许备料给对应的生产单。
