feat: add review_scope field to distinguish cross-review vs standard documents
This commit is contained in:
@@ -76,6 +76,7 @@ class DocumentServiceImpl(IDocumentService):
|
||||
Attachments: list[tuple[str, bytes, str | None]] | None = None,
|
||||
AutoRun: bool = False,
|
||||
Speed: str = "normal",
|
||||
ReviewScope: str = "standard",
|
||||
) -> DocumentUploadVO:
|
||||
"""上传文档并建立 LeAudit document/file 记录。"""
|
||||
if not FileName:
|
||||
@@ -186,6 +187,7 @@ class DocumentServiceImpl(IDocumentService):
|
||||
rootVersionId=rootVersionId,
|
||||
isLatestVersion=True,
|
||||
normalizedName=normalizedName,
|
||||
reviewScope=ReviewScope,
|
||||
)
|
||||
if document.rootVersionId is None:
|
||||
document.rootVersionId = document.Id
|
||||
@@ -355,12 +357,7 @@ class DocumentServiceImpl(IDocumentService):
|
||||
filters.append("d.created_at < (CAST(:date_to AS date) + INTERVAL '1 day')")
|
||||
params["date_to"] = date_type.fromisoformat(DateTo.strip())
|
||||
|
||||
filters.append(
|
||||
"NOT EXISTS ("
|
||||
"SELECT 1 FROM leaudit_cross_review_task_documents crtd"
|
||||
" WHERE crtd.document_id = d.id AND crtd.delete_time IS NULL"
|
||||
")"
|
||||
)
|
||||
filters.append("COALESCE(d.review_scope, 'standard') != 'cross_review'")
|
||||
|
||||
where_clause = " AND ".join(filters)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user