提交 10b258a9 编写于 作者: W wenyann

fix(消息设置):消息设置修改

上级 f64d7a21
......@@ -168,11 +168,11 @@ public class MailService {
}
}
/*新建评审*/
public void sendReviewerNotice(MessageDetail messageDetail, List<String> userIds, SaveTestCaseReviewRequest reviewRequest, String eventType) {
Map<String, String> context = getReviewContext(reviewRequest);
try {
String reviewerTemplate = IOUtils.toString(this.getClass().getResource("/mail/end.html"), StandardCharsets.UTF_8);
String reviewerTemplate = IOUtils.toString(this.getClass().getResource("/mail/reviewer.html"), StandardCharsets.UTF_8);
sendReviewNotice(addresseeIdList(messageDetail, userIds, eventType), context, reviewerTemplate);
} catch (Exception e) {
LogUtil.error(e);
......@@ -385,6 +385,8 @@ public class MailService {
for (String k : context.keySet()) {
if (StringUtils.isNotBlank(context.get(k))) {
template = RegExUtils.replaceAll(template, "\\$\\{" + k + "}", context.get(k));
}else{
template = RegExUtils.replaceAll(template, "\\$\\{" + k + "}", "");
}
}
}
......
......@@ -459,7 +459,7 @@ public class TestCaseReviewService {
wxChatTaskService.sendWechatRobot(r, userIds, context, NoticeConstants.UPDATE);
break;
case NoticeConstants.EMAIL:
mailService.sendReviewerNotice(r, userIds, testCaseReviewRequest, NoticeConstants.UPDATE);
mailService.sendEndNotice(r, userIds, testCaseReviewRequest, NoticeConstants.UPDATE);
break;
}
});
......
......@@ -568,14 +568,18 @@ export default {
handleAddTask(index, data) {
let list = []
if (data.event && data.userIds.length > 0 && data.type) {
data.isSet = false
list.push(data)
let param = {};
param.messageDetail = list
this.result = this.$post("/notice/save/message/task", param, () => {
this.initForm()
this.$success(this.$t('commons.save_success'));
})
if (data.type === 'NAIL_ROBOT' || data.type === 'NAIL_ROBOT') {
this.$warning(this.$t('organization.message.message_webhook'));
} else {
data.isSet = false
list.push(data)
let param = {};
param.messageDetail = list
this.result = this.$post("/notice/save/message/task", param, () => {
this.initForm()
this.$success(this.$t('commons.save_success'));
})
}
} else {
this.$warning(this.$t('organization.message.message'));
}
......
......@@ -234,7 +234,8 @@ export default {
'\n' +
'3. Robots are selected as swarm robots, and "custom keyword" is selected for security verification: "task notification"',
message: 'Event, receiver and receiving method are required\n' +
'\n'
'\n',
message_webhook: 'Webhook is required when the receiving mode is nail or enterprise robot'
},
integration: {
select_defect_platform: 'Please select the defect management platform to be integrated:',
......
......@@ -232,7 +232,8 @@ export default {
notes: '注意: 1.事件,接收方式,接收人为必填项;\n' +
' 2.接收方式除邮件外webhook为必填;\n' +
' 3.机器人选择为群机器人,安全验证选择“自定义关键词” :"任务通知"',
message: '事件,接收人,接收方式为必填项'
message: '事件,接收人,接收方式为必填项',
message_webhook: '接收方式为钉钉和企业机器人时,webhook为必填项'
},
......
......@@ -219,16 +219,18 @@ export default {
defect_manage: '缺陷管理平臺',
message_settings:'消息設定',
message:{
jenkins_task_notification:'Jenkins任務通知',
test_plan_task_notification:'測試計畫任務通知',
test_review_task_notice:'測試評審任務通知',
defect_task_notification:'缺陷任務通知',
create_new_notification:'創建新通知',
select_events:'選擇事件',
select_receiving_method:'選擇接收管道',
mail:'郵件',
nail_robot:'釘釘機器人',
enterprise_wechat_robot:'企業微信機器人',
jenkins_task_notification: 'Jenkins任務通知',
test_plan_task_notification: '測試計畫任務通知',
test_review_task_notice: '測試評審任務通知',
defect_task_notification: '缺陷任務通知',
create_new_notification: '創建新通知',
select_events: '選擇事件',
select_receiving_method: '選擇接收管道',
mail: '郵件',
nail_robot: '釘釘機器人',
enterprise_wechat_robot: '企業微信機器人',
message_webhook: '接收管道為釘釘和企業機器人時,webhook為必填項\n' +
'\n'
},
integration: {
select_defect_platform: '請選擇要集成的缺陷管理平臺:',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册