Skip to content

Commit

Permalink
feat: 红线支持指定到具体的步骤插件 TencentBlueKing#5405
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiKX1 committed Jan 4, 2022
1 parent fbab599 commit 8e93489
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ class QualityIndicatorService @Autowired constructor(
} ?: listOf()
}

fun serviceListALL(indicatorIds: Collection<Long>): List<QualityIndicator> {
val indicatorTMap = indicatorDao.listByIds(dslContext, indicatorIds)?.map { it.id to it }?.toMap()
return indicatorIds.map { id ->
val indicator = indicatorTMap?.get(id) ?: throw OperationException("indicator id $id is not exist")
val metadataIds = convertMetaIds(indicator.metadataIds)
val metadata = metadataService.serviceListMetadata(metadataIds).map {
QualityIndicator.Metadata(it.hashId, it.dataName, it.dataId)
}
convertRecord(indicator, metadata)
}
}

fun serviceList(elementType: String, enNameSet: Collection<String>): List<QualityIndicator> {
return if (enNameSet.isNotEmpty()) {
val indicatorTMap = indicatorDao.listByElementType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class QualityRuleBuildHisService constructor(
val indicatorIdList = it.indicatorIds.split(",").map { id -> id.toLong() }
val thresholdList = it.indicatorThresholds.split(",")
val opList = it.indicatorOperations.split(",")
val qualityIndicatorList = qualityIndicatorService.serviceList(indicatorIdList).toMutableList()
val qualityIndicatorList = qualityIndicatorService.serviceListALL(indicatorIdList).toMutableList()
logger.info("QUALITY|get qualityIndicator: ${qualityIndicatorList.size}")

val rule = QualityRule(
Expand Down

0 comments on commit 8e93489

Please sign in to comment.