Skip to content

Commit

Permalink
Merge pull request #9386 from carlyin0801/issue_atom_hisVersion_cance…
Browse files Browse the repository at this point in the history
…l_fix

bug:选择插件历史版本修复升级后再取消版本校验优化 #9380
  • Loading branch information
bkci-bot authored Sep 4, 2023
2 parents 1538640 + 05b77b2 commit 796b00a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ
)
// 校验前端传的版本号是否正确
val osList = convertUpdateRequest.os
val newestAtomRecord = atomDao.getNewestAtomByCode(dslContext, atomCode)!!
val validateAtomVersionResult =
marketAtomCommonService.validateAtomVersion(
atomRecord = atomRecord,
atomRecord = if (releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE) newestAtomRecord else atomRecord,
releaseType = releaseType,
osList = osList,
version = version
Expand Down Expand Up @@ -488,14 +489,12 @@ abstract class AtomReleaseServiceImpl @Autowired constructor() : AtomReleaseServ
if (atomPackageSourceType == PackageSourceTypeEnum.REPO) {
AtomStatusEnum.COMMITTING
} else AtomStatusEnum.TESTING
val cancelFlag = atomRecord.atomStatus == AtomStatusEnum.GROUNDING_SUSPENSION.status.toByte()
dslContext.transaction { t ->
val context = DSL.using(t)
val props = JsonUtil.toJson(propsMap, formatted = false)
if (releaseType == ReleaseTypeEnum.NEW ||
(cancelFlag && releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE)) {
if (releaseType == ReleaseTypeEnum.NEW || releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE) {
// 首次创建版本或者取消发布后不变更版本号重新上架,则在该版本的记录上做更新操作
atomId = atomRecord.id
atomId = newestAtomRecord.id
updateMarketAtom(
context = context,
userId = userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ class MarketAtomArchiveServiceImpl : MarketAtomArchiveService {
if (null != releaseType) {
val osList = JsonUtil.getObjectMapper().readValue(os, ArrayList::class.java) as ArrayList<String>
val validateAtomVersionResult = marketAtomCommonService.validateAtomVersion(
atomRecord = atomRecord,
atomRecord = if (releaseType == ReleaseTypeEnum.CANCEL_RE_RELEASE) {
atomRecord
} else {
atomDao.getMaxVersionAtomByCode(dslContext, atomCode)!!
},
releaseType = releaseType,
osList = osList,
version = version
Expand Down

0 comments on commit 796b00a

Please sign in to comment.