feat(shipping-notice,receipt-report): 新增收料报表功能并优化发货通知流程
清理废弃的shipping xfa ocr automark相关代码和job配置 新增收料报表管理的前端页面、路由和侧边栏入口 新增后端收料报表配置接口、数据库模型和RPA脚本 优化发货通知流程的重试策略,将shipping相关job默认不自动重试 移除废弃的库存源确认相关逻辑,更新流程门禁规则 重构订单模板的值适配器模块,新增坐标OCR值适配器 清理前端shipping菜单和action的废弃选项 更新相关文档和测试用例,调整.gitignore忽略规则
This commit is contained in:
1 parent
260465b72d
commit
1b6483a4ea
466 files changed
+32115
-33796
No files matched your search
@@ -14,7 +14,13 @@ import pytest
|
||||
|
||||
from app import db
|
||||
from app.core.errors import ConflictError, ValidationError
|
||||
from app.models import ShippingOrderExtraction, ShippingOrderSnapshot, ShippingOrderSnapshotLine, ShippingReservation, ShippingNotice
|
||||
from app.models import (
|
||||
ShippingOrderExtraction,
|
||||
ShippingOrderSnapshot,
|
||||
ShippingOrderSnapshotLine,
|
||||
ShippingReservation,
|
||||
ShippingNotice,
|
||||
)
|
||||
from app.services.shipping_notice.reservation_service import (
|
||||
current_available_snapshot_line_ids,
|
||||
ensure_task_reservations,
|
||||
@@ -48,6 +54,29 @@ def test_rolling_verification_keeps_shortage_pending_and_later_releases_it(app):
|
||||
assert second.result_json['available_count'] == 1
|
||||
|
||||
|
||||
def test_shortage_release_makes_only_its_snapshot_line_exportable(app):
|
||||
"""已审计短缺放行可导出该行,其他 shortage Reservation 仍不能被捎带导出。"""
|
||||
with app.app_context():
|
||||
task, user = _build_accepted_order(suffix='released-shortage-export')
|
||||
snapshot = freeze_order_snapshot(task, actor_id=user.id, expected_order_data_version=7)
|
||||
released_line = snapshot.lines[0]
|
||||
blocked_line = ShippingOrderSnapshotLine(
|
||||
snapshot_id=snapshot.id, position=1, part_number='000126', reservation_id='0012345681',
|
||||
qty=Decimal('3'), field_values_json={},
|
||||
)
|
||||
snapshot.lines.append(blocked_line)
|
||||
db.session.flush()
|
||||
verification = record_inventory_verification(task, inventory_snapshot_id=None, source_config_version='v1', line_results=[
|
||||
{'reservation_id': released_line.reservation_id, 'part_number': released_line.part_number, 'required_qty': released_line.qty, 'available_qty': '0', 'line_status': 'shortage'},
|
||||
{'reservation_id': blocked_line.reservation_id, 'part_number': blocked_line.part_number, 'required_qty': blocked_line.qty, 'available_qty': '0', 'line_status': 'shortage'},
|
||||
])
|
||||
_verification, line_ids = current_available_snapshot_line_ids(
|
||||
task, released_snapshot_line_ids={released_line.id},
|
||||
)
|
||||
|
||||
assert line_ids == {released_line.id}
|
||||
|
||||
|
||||
def test_inventory_verification_uses_frozen_quantity_and_rejects_duplicate_result(app):
|
||||
"""关键断言:库存侧不得缩小需求数量或用重复结果覆盖同一冻结预约单。"""
|
||||
with app.app_context():
|
||||
|
||||
Reference in new issue
Block a user