feat(inbound): handle batch duplication gracefully, support spec search, and auto-fill historical locations
This commit is contained in:
@ -145,7 +145,15 @@ def submit():
|
||||
for field in list(data.keys()):
|
||||
perm_code = field_to_perm.get(field)
|
||||
if perm_code and perm_code not in user_permissions: data.pop(field, None)
|
||||
new_stock = ProductInboundService.handle_inbound(data)
|
||||
|
||||
result = ProductInboundService.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, "msg": "入库成功", "data": new_stock.to_dict()})
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
|
||||
Reference in New Issue
Block a user