Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:组件latestFlag参数更新时组件所有版本修改者会全部更新为同一人 #11400 #11402

Merged
merged 9 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.tencent.devops.model.store.tables.TLabel
import com.tencent.devops.model.store.tables.TStoreMember
import com.tencent.devops.model.store.tables.TStoreStatisticsTotal
import com.tencent.devops.model.store.tables.records.TAtomRecord
import com.tencent.devops.store.common.utils.VersionUtils
import com.tencent.devops.store.pojo.atom.ApproveReq
import com.tencent.devops.store.pojo.atom.MarketAtomCreateRequest
import com.tencent.devops.store.pojo.atom.MarketAtomUpdateRequest
Expand All @@ -47,7 +48,6 @@ import com.tencent.devops.store.pojo.atom.enums.AtomStatusEnum
import com.tencent.devops.store.pojo.atom.enums.AtomTypeEnum
import com.tencent.devops.store.pojo.atom.enums.MarketAtomSortTypeEnum
import com.tencent.devops.store.pojo.common.enums.StoreTypeEnum
import com.tencent.devops.store.common.utils.VersionUtils
import java.math.BigDecimal
import java.time.LocalDateTime
import org.jooq.Condition
Expand Down Expand Up @@ -732,15 +732,19 @@ class MarketAtomDao : AtomBaseDao() {
}
}

fun setupAtomLatestTestFlag(dslContext: DSLContext, userId: String, atomCode: String, atomId: String) {
fun setupAtomLatestTestFlag(
dslContext: DSLContext,
userId: String,
atomCode: String,
atomId: String
) {
with(TAtom.T_ATOM) {
dslContext.update(this)
.set(
LATEST_TEST_FLAG,
DSL.case_().`when`(ID.eq(atomId), true).otherwise(false)
)
.set(MODIFIER, userId)
.where(ATOM_CODE.eq(atomCode))
.set(MODIFIER, DSL.case_().`when`(ID.eq(atomId), userId).otherwise(MODIFIER))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成where条件

.execute()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AtomHandleBuildResultServiceImpl @Autowired constructor(
redisLock.lock()
marketAtomDao.setupAtomLatestTestFlag(
dslContext = dslContext,
userId = storeBuildResultRequest.userId,
userId = atomRecord.modifier,
atomCode = atomCode,
atomId = atomId
)
Expand Down