Skip to content

Commit

Permalink
Merge pull request #9988 from fcfang123/issue-9981
Browse files Browse the repository at this point in the history
feat:推动项目关联运营产品 - 提醒项目管理员关联运营产品 #9981
  • Loading branch information
bkci-bot authored Jan 31, 2024
2 parents 5c9191b + 8e0c8ad commit a322627
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ data class MigrateProjectConditionDTO(
val centerId: Long? = null,
@ApiModelProperty("部门ID")
val deptId: Long? = null,
@ApiModelProperty("bgId")
val bgId: Long? = null,
@ApiModelProperty("项目创建人")
val projectCreator: String? = null,
@ApiModelProperty("排除项目code")
Expand All @@ -19,5 +21,7 @@ data class MigrateProjectConditionDTO(
@ApiModelProperty("资源类型")
val resourceType: String? = null,
@ApiModelProperty("路由tag")
val routerTag: AuthSystemType? = null
val routerTag: AuthSystemType? = null,
@ApiModelProperty("是否关联产品")
val relatedProduct: Boolean? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ class ProjectDao {
): Result<TProjectRecord> {
val centerId = migrateProjectConditionDTO.centerId
val deptId = migrateProjectConditionDTO.deptId
val bdId = migrateProjectConditionDTO.bgId
val excludedProjectCodes = migrateProjectConditionDTO.excludedProjectCodes
val creator = migrateProjectConditionDTO.projectCreator
val routerTag = migrateProjectConditionDTO.routerTag
val isRelatedProduct = migrateProjectConditionDTO.relatedProduct
return with(TProject.T_PROJECT) {
dslContext.selectFrom(this)
.where(APPROVAL_STATUS.notIn(UNSUCCESSFUL_CREATE_STATUS))
Expand All @@ -149,14 +151,23 @@ class ProjectDao {
)
} else {
it.and(
ROUTER_TAG.contains(routerTag.value).or(ROUTER_TAG.contains("devx"))
ROUTER_TAG.like("%${routerTag.value}%").or(ROUTER_TAG.like("%devx%"))
)
}
}
.let { if (centerId == null) it else it.and(CENTER_ID.eq(centerId)) }
.let { if (deptId == null) it else it.and(DEPT_ID.eq(deptId)) }
.let { if (bdId == null) it else it.and(BG_ID.eq(bdId)) }
.let { if (creator == null) it else it.and(CREATOR.eq(creator)) }
.let { if (excludedProjectCodes == null) it else it.and(ENGLISH_NAME.notIn(excludedProjectCodes)) }
.let {
when (isRelatedProduct) {
null -> it
true -> it.and(PRODUCT_ID.isNotNull)
else -> it.and(PRODUCT_ID.isNull)
}
}
.and(ENABLED.eq(true))
.orderBy(CREATED_AT.asc())
.limit(limit)
.offset(offset)
Expand Down
8 changes: 8 additions & 0 deletions support-files/sql/1001_ci_project_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,12 @@ CREATE TABLE IF NOT EXISTS `T_PROJECT_DATA_MIGRATE_HISTORY` (
KEY `INX_TPDMH_TAG` (`TARGET_DATA_TAG`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目数据迁移历史表';

CREATE TABLE IF NOT EXISTS `T_SENIOR_USER` (
`USER_ID` varchar(64) NOT NULL,
`NAME` varchar(64) NOT NULL,
`BG_NAME` varchar(64) NOT NULL,
`CREATE_TIME` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`USER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='高级用户表';

SET FOREIGN_KEY_CHECKS = 1;

0 comments on commit a322627

Please sign in to comment.