出库逻辑添加,扫码识别编码成功,后续对应逻辑没有完成

This commit is contained in:
dxc
2026-02-04 17:22:20 +08:00
parent 596f366fc4
commit 797b611530
12 changed files with 919 additions and 28 deletions

View File

@ -43,7 +43,7 @@ def create_app():
print(f"❌ 错误: Auth 模块导入失败: {e}")
# -----------------------------------------------------
# 2.1 注册入库聚合模块 (Inbound) - 【核心修复点】
# 2.1 注册入库聚合模块 (Inbound)
# -----------------------------------------------------
try:
from app.api.v1.inbound import inbound_bp
@ -79,7 +79,7 @@ def create_app():
print(f"❌ 错误: Upload 模块导入失败: {e}")
# -----------------------------------------------------
# 2.4 注册业务操作模块 (Transactions)
# 2.4 注册业务操作模块 (Transactions - 借还/维修/报废)
# -----------------------------------------------------
try:
from app.api.v1.transactions import trans_bp
@ -90,6 +90,19 @@ def create_app():
# 允许模块不存在时不崩溃
print(f"⚠️ 提示: Transaction 模块尚未创建或导入失败: {e}")
# -----------------------------------------------------
# 2.5 ★ [新增] 注册出库模块 (Outbound)
# -----------------------------------------------------
try:
from app.api.v1.outbound import outbound_bp
# 标准: /api/v1/outbound
app.register_blueprint(outbound_bp, url_prefix='/api/v1/outbound')
# 兼容: /api/outbound
app.register_blueprint(outbound_bp, url_prefix='/api/outbound', name='outbound_legacy')
print("✅ Outbound 模块注册成功")
except ImportError as e:
print(f"❌ 错误: Outbound 模块导入失败: {e}")
# =========================================================
# 3. 预加载数据模型
# =========================================================
@ -101,6 +114,9 @@ def create_app():
from app.models.inbound.semi import StockSemi
from app.models.inbound.product import StockProduct
# ★ [新增] 出库模型 (确保迁移工具能检测到 trans_outbound 表)
from app.models.outbound import TransOutbound
# 系统与业务模型
from app.models.system import SysUser, SysLog
from app.models.transaction import TransBorrow, TransRepair, TransScrap