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

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_inbound_list(
inbound_page_query: Annotated[InboundPageQueryModel, Query()],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await InboundService.get_inbound_list_services(
query_db,
inbound_page_query,
current_user,
test_scope,
is_page=True,
)
return ResponseUtil.success(model_content=result)
@@ -64,8 +68,9 @@ async def get_business_inbound_warehouse_options(
request: Request,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await InboundService.get_warehouse_options_services(query_db, current_user)
result = await InboundService.get_warehouse_options_services(query_db, current_user, test_scope)
return ResponseUtil.success(data=result)
@@ -85,12 +90,14 @@ async def scan_business_inbound_pallet(
inbound_scan_query: Annotated[InboundScanQueryModel, Query()],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency()],
) -> Response:
result = await InboundService.scan_inbound_pallet_services(
query_db,
qr_token,
inbound_scan_query,
current_user,
test_scope,
)
return ResponseUtil.success(data=result)
@@ -107,8 +114,9 @@ async def query_detail_business_inbound(
inbound_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 InboundService.inbound_detail_services(query_db, inbound_id, current_user)
result = await InboundService.inbound_detail_services(query_db, inbound_id, current_user, test_scope)
return ResponseUtil.success(data=result)
@@ -125,8 +133,9 @@ async def add_business_inbound(
add_inbound: InboundCreateModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await InboundService.add_inbound_services(query_db, add_inbound, current_user)
result = await InboundService.add_inbound_services(query_db, add_inbound, current_user, test_scope)
return ResponseUtil.success(msg=result.message)
@@ -143,8 +152,9 @@ async def edit_business_inbound(
edit_inbound: InboundUpdateModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await InboundService.edit_inbound_services(query_db, edit_inbound, current_user)
result = await InboundService.edit_inbound_services(query_db, edit_inbound, current_user, test_scope)
return ResponseUtil.success(msg=result.message)
@@ -164,11 +174,13 @@ async def delete_business_inbound(
],
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await InboundService.delete_inbound_services(
query_db,
[int(inbound_id) for inbound_id in inbound_ids.split(',')],
current_user,
test_scope,
)
return ResponseUtil.success(msg=result.message)
@@ -187,11 +199,13 @@ async def confirm_business_inbound(
confirm_command: ConfirmCommandModel,
query_db: Annotated[AsyncSession, DBSessionDependency()],
current_user: Annotated[CurrentUserModel, CurrentUserDependency()],
test_scope: Annotated[TestBatchScope, TestBatchScopeDependency(write=True)],
) -> Response:
result = await InboundService.confirm_inbound_services(
query_db,
inbound_id,
confirm_command,
current_user,
test_scope,
)
return ResponseUtil.success(msg=result.message)