feat(inbound): handle batch duplication gracefully, support spec search, and auto-fill historical locations

This commit is contained in:
DXC
2026-04-08 09:41:04 +08:00
parent c58a0a6d14
commit 9380508a89
9 changed files with 141 additions and 15 deletions

View File

@ -218,7 +218,13 @@ def submit():
if not location:
return jsonify({"code": 400, "msg": "入库失败:库位为必填项,不能为空!"}), 400
new_stock = BuyInboundService.handle_inbound(data)
result = BuyInboundService.handle_inbound(data)
# 检查是否返回了业务校验错误
if isinstance(result, dict) and result.get('error'):
return jsonify({"code": 400, "msg": result['error']}), 400
new_stock = result
return jsonify({
"code": 200,