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

feat:推动项目关联运营产品 - 提醒项目管理员关联运营产品 #9981 #9988

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -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;
Loading