refactor(orm): 将所有的批量 delete/update 重构为对象级操作,以确保触发 SQLAlchemy 审计事件

This commit is contained in:
DXC
2026-04-20 15:43:48 +08:00
parent 7e72c12f30
commit a849e14b2c
4 changed files with 54 additions and 22 deletions

View File

@ -218,8 +218,8 @@ def delete_bom(bom_no):
if not exist:
return jsonify({'code': 404, 'msg': 'BOM 不存在'}), 404
# 删除
query.delete()
# 删除(改为对象级删除以触发审计事件)
db.session.delete(exist)
db.session.commit()
return jsonify({
'code': 200,