Files
leaudit-platform-backend/fastapi_modules/fastapi_leaudit/services/crossReviewService.py
T

133 lines
4.0 KiB
Python

"""交叉评查服务接口。"""
from abc import ABC, abstractmethod
from fastapi_modules.fastapi_leaudit.domian.Dto.crossReviewDto import (
CrossReviewProposalCreateDTO,
CrossReviewProposalVoteDTO,
CrossReviewTaskCreateDTO,
CrossReviewTaskDocumentQueryDTO,
CrossReviewTaskQueryDTO,
)
from fastapi_modules.fastapi_leaudit.domian.vo.crossReviewVo import (
CrossReviewTaskDocumentAppendVO,
CrossReviewPendingVotesVO,
CrossReviewPermissionVO,
CrossReviewProposalCancelVO,
CrossReviewProposalCreateVO,
CrossReviewProposalPageVO,
CrossReviewProposalVoteVO,
CrossReviewTaskCompleteVO,
CrossReviewTaskCreateVO,
CrossReviewTaskDocumentPageVO,
CrossReviewTaskDocumentUploadVO,
CrossReviewTaskPageVO,
CrossReviewTaskProgressVO,
)
class ICrossReviewService(ABC):
"""交叉评查服务接口。"""
@abstractmethod
async def CreateTask(self, CurrentUserId: int, Body: CrossReviewTaskCreateDTO) -> CrossReviewTaskCreateVO:
"""创建交叉评查任务。"""
...
@abstractmethod
async def GetUserTasks(self, CurrentUserId: int, Body: CrossReviewTaskQueryDTO) -> CrossReviewTaskPageVO:
"""查询当前用户参与的交叉评查任务。"""
...
@abstractmethod
async def GetTaskProgress(self, CurrentUserId: int, TaskId: int) -> CrossReviewTaskProgressVO:
"""查询任务进度。"""
...
@abstractmethod
async def GetTaskDocuments(
self,
CurrentUserId: int,
TaskId: int,
Body: CrossReviewTaskDocumentQueryDTO,
) -> CrossReviewTaskDocumentPageVO:
"""查询任务文档列表。"""
...
@abstractmethod
async def CanConfirmTaskDocument(self, CurrentUserId: int, TaskId: int) -> CrossReviewPermissionVO:
"""判断当前用户是否有权确认任务文档完成。"""
...
@abstractmethod
async def CompleteTaskDocument(self, CurrentUserId: int, TaskId: int, DocumentId: int) -> CrossReviewTaskCompleteVO:
"""确认任务文档完成。"""
...
@abstractmethod
async def CreateProposal(self, CurrentUserId: int, Body: CrossReviewProposalCreateDTO) -> CrossReviewProposalCreateVO:
"""创建交叉评查提案。"""
...
@abstractmethod
async def VoteProposal(
self,
CurrentUserId: int,
ProposalId: int,
Body: CrossReviewProposalVoteDTO,
) -> CrossReviewProposalVoteVO:
"""对交叉评查提案投票。"""
...
@abstractmethod
async def CancelProposal(self, CurrentUserId: int, ProposalId: int) -> CrossReviewProposalCancelVO:
"""撤销交叉评查提案。"""
...
@abstractmethod
async def GetDocumentProposals(
self,
CurrentUserId: int,
DocumentId: int,
Page: int,
PageSize: int,
) -> CrossReviewProposalPageVO:
"""获取文档提案列表。"""
...
@abstractmethod
async def GetDocumentPendingVotes(self, CurrentUserId: int, DocumentId: int) -> CrossReviewPendingVotesVO:
"""获取文档待投票信息。"""
...
@abstractmethod
async def ExportDocumentProposals(self, CurrentUserId: int, DocumentId: int) -> tuple[bytes, str]:
"""导出文档交叉评查意见 Excel。"""
...
@abstractmethod
async def UploadTaskDocument(
self,
CurrentUserId: int,
TaskId: int,
FileName: str,
FileContent: bytes,
ContentType: str | None,
TypeId: int | None = None,
GroupId: int | None = None,
) -> CrossReviewTaskDocumentUploadVO:
"""向交叉评查任务补传文档。"""
...
@abstractmethod
async def AppendTaskDocumentAttachments(
self,
CurrentUserId: int,
TaskId: int,
DocumentId: int,
Files: list[tuple[str, bytes, str | None]],
Remark: str | None = None,
) -> CrossReviewTaskDocumentAppendVO:
"""为交叉评查任务文档追加附件,并生成同版本链新版本。"""
...