Skip to content

Commit

Permalink
feat:用户个人视角 权限管理优化 #11138
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Dec 25, 2024
1 parent c82564c commit 3c07a4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ enum class HandoverAction(
val content: String
) {
// 审批成功
AGREE(1, "已通过", "您提交的权限交接单 %s 已被 %s 通过。恭喜您完成交接。"),
AGREE(1, "已通过", "您提交的权限交接单 %s 已被 %s <font color=\"#FF0000\">通过</font>。恭喜您完成交接。"),

// 审批驳回
REJECT(2, "已拒绝", "您提交的权限交接单 %s 已被 %s 拒绝。请重新交接。"),
REJECT(2, "已拒绝", "您提交的权限交接单 %s 已被 %s <font color=\"#FF0000\">拒绝</font>。请重新交接。"),

// 撤销
REVOKE(3, "撤销", "已撤销");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,21 @@ class RbacPermissionHandoverApplicationService(
titleOfApplication = titleOfApplication.plus(" $groupCount ").plus(
bkHandoverGroups.plus("").plus(" $authorizationCount ").plus(bkHandoverAuthorizations)
)
handoverOverviewContentOfEmail = """<span class="num">$groupCount</span>$bkHandoverGroups,<span class="num">$authorizationCount</span>$bkHandoverAuthorizations""".trimMargin()
handoverOverviewContentOfEmail = """<span class="num"> $groupCount </span>$bkHandoverGroups,<span class="num"> $authorizationCount </span>$bkHandoverAuthorizations""".trimMargin()
handoverOverviewContentOfRtx = handoverOverviewContentOfRtx.plus(groupCount).plus(
bkHandoverGroups.plus("").plus(authorizationCount).plus(bkHandoverAuthorizations)
)
}

groupCount > 0 -> {
titleOfApplication = titleOfApplication.plus(" $groupCount ").plus(bkHandoverGroups)
handoverOverviewContentOfEmail = """<span class="num">$groupCount</span>$bkHandoverGroups""".trimMargin()
handoverOverviewContentOfEmail = """<span class="num"> $groupCount </span>$bkHandoverGroups""".trimMargin()
handoverOverviewContentOfRtx = handoverOverviewContentOfRtx.plus(groupCount).plus(bkHandoverGroups)
}

else -> {
titleOfApplication = titleOfApplication.plus(" $authorizationCount ").plus(bkHandoverAuthorizations)
handoverOverviewContentOfEmail = """<span class="num">$authorizationCount</span>$bkHandoverAuthorizations""".trimMargin()
handoverOverviewContentOfEmail = """<span class="num"> $authorizationCount </span>$bkHandoverAuthorizations""".trimMargin()
handoverOverviewContentOfRtx = handoverOverviewContentOfRtx.plus(authorizationCount).plus(bkHandoverAuthorizations)
}
}
Expand Down Expand Up @@ -356,8 +356,7 @@ class RbacPermissionHandoverApplicationService(
).map { it.copy(approver = flowNo2Approver[it.flowNo]) }
}

private val handoverApplicationUrl =
"${config.devopsHostGateway}/console/permission/my-handover?type=handoverToMe&flowNo=%s"
private val handoverApplicationUrl = "${config.devopsHostGateway}/console/permission/my-handover?type=handoverToMe&flowNo=%s"

companion object {
private val logger = LoggerFactory.getLogger(RbacPermissionHandoverApplicationService::class.java)
Expand Down
8 changes: 4 additions & 4 deletions support-files/i18n/notify/template_zh_CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1021,15 +1021,15 @@
emailTemplate:
id: "d57d7358f5034b21acafde62f27d75fd"
title: "蓝盾权限交接申请"
body: "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>蓝盾DevOps平台</title>\n <style>\n * {\n box-sizing: border-box;\n }\n\n .content-wrapper .num {\n color: #4e90ff;\n }\n td, th {\n padding: 10px;\n font-size: 12px;\n }\n </style>\n</head>\n\n<body>\n <table class=\"template-table\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"1000\" style=\"margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff; background: #fff;\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" width=\"100%\" style=\"padding: 16px;\">\n <table>\n <tbody>\n <tr>\n <td valign=\"top\" style=\"padding: 0 24px;\" bgcolor=\"#f9f8f6\" align=\"center\">\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"font-size: 16px; margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt;\">\n <tr>\n <td style=\"background: #fff; border-radius: 10px;box-shadow: 0 2px 10px 0 #19192926;position: relative; top: -30px;\">\n <div style=\"padding: 20px 36px;background-color: #fff; border-radius: 10px;\">\n <p style=\"padding-bottom: 20px; line-height: 2; border-bottom: 1px solid #e6e6e6;font-size: 24px; \">蓝盾权限交接申请</p>\n <div class=\"content-wrapper\" style=\"color: #313238;font-size: 16px;line-height: 2;\">\n <p style=\"margin: 0;padding: 0;\">您好,${handoverTo}:</p>\n <p style=\"margin: 0;padding: 0;\"><span> ${handoverFrom} </span>已申请将蓝盾项目[${projectName}]下的 ${handoverOverviews} 移交给您,请确认是否接收。</p>\n </div>\n <table style=\"border-collapse: collapse; width: 100%;\" bgcolor=\"#fff\" >\n <thead>\n <tr>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">交接类型</th>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">资源类型</th>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">数量</th>\n </tr>\n </thead>\n <tbody>${table}</tbody>\n </table>\n <a href=${url} style=\"display: block;width: 300px;padding: 10px;margin: 0 auto;background-color: #3498db;color: #fff;text-align: center;text-decoration: none;border-radius: 30px;margin-top: 50px;\">马上处理</a>\n </div>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n\n</body>\n\n</html>"
body: "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>蓝盾DevOps平台</title>\n <style>\n * {\n box-sizing: border-box;\n }\n\n .content-wrapper .num {\n color: #4e90ff;\n }\n td, th {\n padding: 10px;\n font-size: 12px;\n }\n </style>\n</head>\n\n<body>\n <table class=\"template-table\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"1000\" style=\"margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff; background: #fff;\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" width=\"100%\" style=\"padding: 16px;\">\n <table>\n <tbody>\n <tr>\n <td valign=\"top\" style=\"padding: 0 24px;\" bgcolor=\"#f9f8f6\" align=\"center\">\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"font-size: 16px; margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt;\">\n <tr>\n <td style=\"background: #fff; border-radius: 10px;box-shadow: 0 2px 10px 0 #19192926;position: relative; top: -30px;\">\n <div style=\"padding: 20px 36px;background-color: #fff; border-radius: 10px;\">\n <p style=\"padding-bottom: 20px; line-height: 2; border-bottom: 1px solid #e6e6e6;font-size: 24px; \">蓝盾权限交接申请</p>\n <div class=\"content-wrapper\" style=\"color: #313238;font-size: 16px;line-height: 2;\">\n <p style=\"margin: 0;padding: 0;\">你好,${handoverTo}:</p>\n <p style=\"margin: 0;padding: 0;\"><span> ${handoverFrom} </span>已申请将蓝盾项目[${projectName}]下的 ${handoverOverviews}移交给你,请确认是否接收。</p>\n </div>\n <table style=\"border-collapse: collapse; width: 100%;\" bgcolor=\"#fff\" >\n <thead>\n <tr>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">交接类型</th>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">资源类型</th>\n <th style=\"font-weight: 500;background: #FAFBFD;text-align: left;border-bottom: 1px solid #ddd;\">数量</th>\n </tr>\n </thead>\n <tbody>${table}</tbody>\n </table>\n <a href=${url} style=\"display: block;width: 300px;padding: 10px;margin: 0 auto;background-color: #3498db;color: #fff;text-align: center;text-decoration: none;border-radius: 30px;margin-top: 50px;\">马上处理</a>\n </div>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n\n</body>\n\n</html>"
sender: "DevOps"
bodyFormat: 1
emailType: 1
weworkTemplate:
id: "84f28ea9f6c44afaa3b7777cc286c18c"
sender: "DevOps"
title: "【蓝盾权限】移交通知"
body: "${handoverFrom}已申请将蓝盾项目【${projectName}】下的 ${handoverOverviewContentOfRtx}移交给您,请确认是否接收 \n去处理:${url}"
body: "${handoverFrom}申请将蓝盾项目【${projectName}】下的 ${handoverOverviewContentOfRtx}移交给你,请确认是否接收 \n去处理:${url}"
creator: "system"
modifior: "system"
- index: 49
Expand All @@ -1044,14 +1044,14 @@
emailTemplate:
id: "902b30b05d184f478ea8eaaea53533f1"
title: "蓝盾权限交接申请"
body: "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>蓝盾DevOps平台</title>\n <style>\n * {\n box-sizing: border-box;\n }\n\n .content-wrapper .num {\n color: #4e90ff;\n }\n td, th {\n padding: 5px;\n }\n </style>\n</head>\n\n<body>\n <table class=\"template-table\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"1000\" style=\"margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff; background: #fff;\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" width=\"100%\" style=\"padding: 16px;\">\n <table>\n <tbody>\n <tr>\n <td valign=\"top\" style=\"padding: 0 24px;\" bgcolor=\"#f9f8f6\" align=\"center\">\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"font-size: 16px; margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt;\">\n <tr>\n <td style=\"background: #fff; border-radius: 10px;position: relative; top: -30px;\">\n <div style=\"padding: 20px 36px;background-color: #fff;box-shadow: 0 2px 10px 0 #19192926; border-radius: 10px;\">\n <p style=\"padding-bottom: 20px; line-height: 2; border-bottom: 1px solid #e6e6e6; font-size: 24px; \">蓝盾权限交接申请 - ${result}</p>\n <div class=\"content-wrapper\" style=\"color: #313238;font-size: 18px;line-height: 2;\">\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">您好,${handoverFrom}</p>\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">${content}</p>\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">审核意见:${remark}</p>\n </div>\n <a href=${url} style=\"display: block;width: 300px;padding: 10px;margin: 0 auto;background-color: #3498db;color: #fff;text-align: center;text-decoration: none;border-radius: 30px;margin-top: 50px;\">查看更多</a>\n </div>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n\n</body>\n\n</html>\n "
body: "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>蓝盾DevOps平台</title>\n <style>\n * {\n box-sizing: border-box;\n }\n\n .content-wrapper .num {\n color: #4e90ff;\n }\n td, th {\n padding: 5px;\n }\n </style>\n</head>\n\n<body>\n <table class=\"template-table\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"1000\" style=\"margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #fff; background: #fff;\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"top\" width=\"100%\" style=\"padding: 16px;\">\n <table>\n <tbody>\n <tr>\n <td valign=\"top\" style=\"padding: 0 24px;\" bgcolor=\"#f9f8f6\" align=\"center\">\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"font-size: 16px; margin: 0 auto; mso-table-lspace: 0pt; mso-table-rspace: 0pt;\">\n <tr>\n <td style=\"background: #fff; border-radius: 10px;position: relative; top: -30px;\">\n <div style=\"padding: 20px 36px;background-color: #fff;box-shadow: 0 2px 10px 0 #19192926; border-radius: 10px;\">\n <p style=\"padding-bottom: 20px; line-height: 2; border-bottom: 1px solid #e6e6e6; font-size: 24px; \">蓝盾权限交接申请 - ${result}</p>\n <div class=\"content-wrapper\" style=\"color: #313238;font-size: 18px;line-height: 2;\">\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">你好,${handoverFrom}</p>\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">${content}</p>\n <p style=\"margin: 0;padding: 0; font-size: 15px;\">审核意见:${remark}</p>\n </div>\n <a href=${url} style=\"display: block;width: 300px;padding: 10px;margin: 0 auto;background-color: #3498db;color: #fff;text-align: center;text-decoration: none;border-radius: 30px;margin-top: 50px;\">查看详情</a>\n </div>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n\n</body>\n\n</html>\n "
sender: "DevOps"
bodyFormat: 1
emailType: 1
weworkTemplate:
id: "4ead2e88f2a94fcbb7b1ffc5c523f742"
sender: "DevOps"
title: "蓝盾权限交接申请 - ${result}"
body: "您好,${handoverFrom} \n${content} \n审核意见:${remark} \n更多详情查看:${url}"
body: "你好,${handoverFrom} \n${content} \n审核意见:${remark} \n更多详情查看:${url}"
creator: "system"
modifior: "system"

0 comments on commit 3c07a4a

Please sign in to comment.