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:研发商店组件审核发布时录入T_STORE_RELEASE表的首次发布人有误 #11366 #11408

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Kzhou991
Copy link
Collaborator

No description provided.

@@ -348,7 +348,8 @@ class OpAtomServiceImpl @Autowired constructor(
atomStatus = atomStatus,
releaseType = releaseType,
repositoryHashId = atom.repositoryHashId,
branch = atom.branch
branch = atom.branch,
publisher = atom.publisher
Copy link
Collaborator

Choose a reason for hiding this comment

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

这是首次发布人吗?publisher有可能是组织,这个需求应该取首个版本的创建人数据录入

@PUT
@Path("/updateComponentFirstPublisher")
fun updateComponentFirstPublisher(
@Parameter(description = "userId", required = true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

需要一键刷新所有历史数据的op接口,不是人工一个个改

lateinit var dslContext: DSLContext

@Autowired
lateinit var atomDao: MarketAtomDao
Copy link
Collaborator

Choose a reason for hiding this comment

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

这是公共模块,怎么依赖特定业务模块的bean,这需要用设计模式屏蔽差异



@Service
class StoreCoreComponentDataCorrectionServiceImpl : StoreComponentDataCorrectionService() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

StoreComponentDataCorrectionService这类名称起的不好

fun updateFirstPublisherIfNecessary(
storeTypeEnum: StoreTypeEnum,
list: List<Component>?,
dao: StoreReleaseDao,
Copy link
Collaborator

Choose a reason for hiding this comment

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

dao和dslContext为什么要作参数传?

.select(tAtom.ATOM_CODE, tAtomVersionLog.MODIFIER)
.from(tAtom)
.join(tAtomVersionLog)
.on(tAtom.ID.eq(tAtomVersionLog.ATOM_ID))
Copy link
Collaborator

Choose a reason for hiding this comment

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

关联tAtomVersionLog干什么,一次把所有记录都查出来吗?没有考虑性能问题


fun selectStoreReleaseInfo(
dslContext: DSLContext,
storeCode: List<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

集合字段名称应该定义成storeCodes吧

override fun updateComponentFirstPublisher(
userId: String,
): Boolean {
storeComponentDataCorrectionService.updateComponentFirstPublisher(userId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

一次更新这么多组件,更新逻辑应该搞成异步的吧

@@ -911,4 +913,39 @@ class MarketAtomDao : AtomBaseDao() {
}
}
}

fun listByAtomCode(dslContext: DSLContext): Result<Record2<String, String>>? {
val tAtom = TAtom.T_ATOM.`as`("t_atom")
Copy link
Collaborator

Choose a reason for hiding this comment

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

.as("t_atom")之类的代码不用写


val imageList = imageDao.listByImageCode(dslContext)?.map { Component(it.value1(), it.value2()) }
updateFirstPublisherIfNecessary(StoreTypeEnum.IMAGE, imageList, storeReleaseDao, dslContext, userId)
} catch (e: Exception) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

异常统一用ignored: Throwable

val imageList = imageDao.listByImageCode(dslContext)?.map { Component(it.value1(), it.value2()) }
updateFirstPublisherIfNecessary(StoreTypeEnum.IMAGE, imageList, storeReleaseDao, dslContext, userId)
} catch (e: Exception) {
logger.info("updateComponentFirstPublisher error:${e.message}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

logger日志打印不规范,应该至少使用warn级别吧

val tAtomChild = TAtom.T_ATOM.`as`("t_atom_child")
val tAtomVersionLog = TAtomVersionLog.T_ATOM_VERSION_LOG

val minCreateTimeSubquery = dslContext.select(min(tAtomChild.CREATE_TIME))
Copy link
Collaborator

Choose a reason for hiding this comment

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

这么分组没看懂,确定没问题吗?都没体现是按组件分组?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants