From 768f17ce102fe398580301146e4ee6017c27a6ba Mon Sep 17 00:00:00 2001 From: zacYL <100330102+zacYL@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:57:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=81=A2=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E8=B0=83=E6=95=B4#2754?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../separation/service/impl/SeparationTaskServiceImpl.kt | 9 ++++----- .../impl/repo/MavenRepoSpecialDataSeparatorHandler.kt | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/SeparationTaskServiceImpl.kt b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/SeparationTaskServiceImpl.kt index 1a2cb4cf93..4c2fa13b21 100644 --- a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/SeparationTaskServiceImpl.kt +++ b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/SeparationTaskServiceImpl.kt @@ -37,7 +37,6 @@ import com.tencent.bkrepo.common.mongo.util.Pages import com.tencent.bkrepo.common.security.util.SecurityUtils import com.tencent.bkrepo.job.RESTORE import com.tencent.bkrepo.job.SEPARATE -import com.tencent.bkrepo.job.SEPARATION_TASK_COLLECTION_NAME import com.tencent.bkrepo.job.separation.config.DataSeparationConfig import com.tencent.bkrepo.job.separation.dao.SeparationFailedRecordDao import com.tencent.bkrepo.job.separation.dao.SeparationTaskDao @@ -100,10 +99,10 @@ class SeparationTaskServiceImpl( projectId?.apply { criteria.and(TSeparationTask::projectId.name).isEqualTo(projectId) } repoName?.apply { criteria.and(TSeparationTask::repoName.name).isEqualTo(repoName) } val query = Query(criteria) - val dateRecords = mongoTemplate.findDistinct( - query, TSeparationTask::separationDate.name, SEPARATION_TASK_COLLECTION_NAME, LocalDateTime::class.java - ) - result.addAll(dateRecords) + val dateRecords = mongoTemplate.find(query, TSeparationTask::class.java) + dateRecords.forEach { + result.add(it.separationDate) + } return result } diff --git a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/repo/MavenRepoSpecialDataSeparatorHandler.kt b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/repo/MavenRepoSpecialDataSeparatorHandler.kt index 985286b4d1..8aa293c02d 100644 --- a/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/repo/MavenRepoSpecialDataSeparatorHandler.kt +++ b/src/backend/job/biz-job/src/main/kotlin/com/tencent/bkrepo/job/separation/service/impl/repo/MavenRepoSpecialDataSeparatorHandler.kt @@ -46,7 +46,7 @@ import com.tencent.bkrepo.job.separation.pojo.query.NodeDetailInfo import com.tencent.bkrepo.job.separation.service.RepoSpecialDataSeparator import com.tencent.bkrepo.job.separation.util.SeparationUtils import com.tencent.bkrepo.job.separation.util.SeparationUtils.getNodeCollectionName -import com.tencent.bkrepo.maven.util.MavenGAVCUtils.toMavenGAVC +import com.tencent.bkrepo.maven.util.MavenGAVCUtils.mavenGAVC import com.tencent.bkrepo.maven.util.MavenStringUtils.formatSeparator import com.tencent.bkrepo.maven.util.MavenUtil.extractGroupIdAndArtifactId import com.tencent.bkrepo.maven.util.MavenUtil.extractPath @@ -210,7 +210,7 @@ class MavenRepoSpecialDataSeparatorHandler( override fun getRecoveryPackageVersionData(recoveryInfo: RecoveryNodeInfo): RecoveryVersionInfo { with(recoveryInfo) { - val mavenGAVC = fullPath.toMavenGAVC() + val mavenGAVC = fullPath.mavenGAVC() val version = mavenGAVC.version val artifactId = mavenGAVC.artifactId val groupId = mavenGAVC.groupId.formatSeparator("/", ".")