diff --git a/.qwen/settings.json b/.qwen/settings.json index 10d6b5c..d0e48be 100644 --- a/.qwen/settings.json +++ b/.qwen/settings.json @@ -4,5 +4,6 @@ "Bash(git add *)", "Bash(git commit *)" ] - } + }, + "$version": 3 } \ No newline at end of file diff --git a/.qwen/settings.json.orig b/.qwen/settings.json.orig new file mode 100644 index 0000000..10d6b5c --- /dev/null +++ b/.qwen/settings.json.orig @@ -0,0 +1,8 @@ +{ + "permissions": { + "allow": [ + "Bash(git add *)", + "Bash(git commit *)" + ] + } +} \ No newline at end of file diff --git a/deploy.tar.gz b/deploy.tar.gz index d4ee3da..20034c9 100644 Binary files a/deploy.tar.gz and b/deploy.tar.gz differ diff --git a/inventory-backend/app/api/v1/warehouse.py b/inventory-backend/app/api/v1/warehouse.py index 4c5139c..ad42d4f 100644 --- a/inventory-backend/app/api/v1/warehouse.py +++ b/inventory-backend/app/api/v1/warehouse.py @@ -171,10 +171,13 @@ def delete_location(location_id): """ try: location = SysWarehouseLocation.query.get(location_id) - + if not location: return jsonify({'code': 404, 'msg': '库位不存在', 'data': None}) - + + # 在删除前提取属性,避免 commit 后访问已删除对象 + location_code = location.location_code + # 递归删除所有子库位 def delete_recursive(loc): # 先删除所有子节点 @@ -183,14 +186,14 @@ def delete_location(location_id): delete_recursive(child) # 再删除自身 db.session.delete(loc) - + delete_recursive(location) db.session.commit() return jsonify({ 'code': 200, 'msg': '删除成功', - 'location_code': location.location_code + 'location_code': location_code }) except Exception as e: db.session.rollback() diff --git a/inventory-backend/app/services/print/printer_config.json b/inventory-backend/app/services/print/printer_config.json index e402bc2..fd87d21 100644 --- a/inventory-backend/app/services/print/printer_config.json +++ b/inventory-backend/app/services/print/printer_config.json @@ -1,6 +1,6 @@ { "label_printer": { - "ip": "172.16.0.119", + "ip": "192.168.9.14", "port": 9100 }, "network_printer": { diff --git a/inventory-backend/打印测试代码.py b/inventory-backend/打印测试代码.py index d9e7257..5fe1aa1 100644 --- a/inventory-backend/打印测试代码.py +++ b/inventory-backend/打印测试代码.py @@ -1,7 +1,7 @@ import socket # ================= 配置区域 ================= -PRINTER_IP = '192.168.9.89' +PRINTER_IP = '192.168.9.101' PRINTER_PORT = 9100