功能:隔离五类测试业务链路

This commit is contained in:
焦龙言
2026-09-23 08:27:14 +08:00
parent 43fe17cc70
commit f5df2150d8
18 changed files with 1206 additions and 831 deletions
@@ -11,6 +11,8 @@ from common.enums import BusinessType
from common.router import APIRouterPro
from common.vo import DataResponseModel, PageResponseModel, ResponseBaseModel
from module_admin.entity.vo.user_vo import CurrentUserModel
from module_business.dependency.test_batch_dependency import TestBatchScopeDependency
from module_business.domain.test_batch_scope import TestBatchScope
from module_business.entity.vo.operation_vo import (
BusinessOptionModel,
ConfirmCommandModel,
@@ -43,11 +45,13 @@ async def get_business_shipment_list(
shipment_page_query: Annotated[ShipmentPageQueryModel, Query()],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await ShipmentService.get_shipment_list_services(
query_db,
shipment_page_query,
current_user,
test_scope,
is_page=True,
)
return ResponseUtil.success(model_content=result)
@@ -64,8 +68,9 @@ async def get_business_shipment_warehouse_options(
request: Request,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await ShipmentService.get_warehouse_options_services(query_db, current_user)
result = await ShipmentService.get_warehouse_options_services(query_db, current_user, test_scope)
return ResponseUtil.success(data=result)
@@ -80,8 +85,9 @@ async def get_business_shipment_site_options(
request: Request,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await ShipmentService.get_site_options_services(query_db, current_user)
result = await ShipmentService.get_site_options_services(query_db, current_user, test_scope)
return ResponseUtil.success(data=result)
@@ -101,12 +107,14 @@ async def scan_business_shipment_pallet(
shipment_scan_query: Annotated[ShipmentScanQueryModel, Query()],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await ShipmentService.scan_shipment_pallet_services(
query_db,
qr_token,
shipment_scan_query,
current_user,
test_scope,
)
return ResponseUtil.success(data=result)
@@ -123,8 +131,9 @@ async def query_detail_business_shipment(
shipment_id: Annotated[int, Path(gt=0, description='发货单ID')],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await ShipmentService.shipment_detail_services(query_db, shipment_id, current_user)
result = await ShipmentService.shipment_detail_services(query_db, shipment_id, current_user, test_scope)
return ResponseUtil.success(data=result)
@@ -141,8 +150,9 @@ async def add_business_shipment(
add_shipment: ShipmentCreateModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await ShipmentService.add_shipment_services(query_db, add_shipment, current_user)
result = await ShipmentService.add_shipment_services(query_db, add_shipment, current_user, test_scope)
return ResponseUtil.success(msg=result.message)
@@ -159,8 +169,9 @@ async def edit_business_shipment(
edit_shipment: ShipmentUpdateModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await ShipmentService.edit_shipment_services(query_db, edit_shipment, current_user)
result = await ShipmentService.edit_shipment_services(query_db, edit_shipment, current_user, test_scope)
return ResponseUtil.success(msg=result.message)
@@ -180,11 +191,13 @@ async def delete_business_shipment(
],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await ShipmentService.delete_shipment_services(
query_db,
[int(shipment_id) for shipment_id in shipment_ids.split(',')],
current_user,
test_scope,
)
return ResponseUtil.success(msg=result.message)
@@ -203,11 +216,13 @@ async def confirm_business_shipment(
confirm_command: ConfirmCommandModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await ShipmentService.confirm_shipment_services(
query_db,
shipment_id,
confirm_command,
current_user,
test_scope,
)
return ResponseUtil.success(msg=result.message)