Commit 4f4bcf41 authored by 黎博's avatar 黎博

线上工单为0时发送消息修改

parent f841ba8a
...@@ -317,26 +317,35 @@ public class DingdingUtils { ...@@ -317,26 +317,35 @@ public class DingdingUtils {
public static String buildDailyProdBugNotifyMsg(Iterable<Issue> issues) { public static String buildDailyProdBugNotifyMsg(Iterable<Issue> issues) {
String title = "线上未解决工单统计"; String title = "线上未解决工单统计";
String content = "📣线上未解决工单统计:" + "\n\n"; String content = "📣线上未解决工单统计:" + "\n\n";
int count = 0; List<Issue> issueList = new ArrayList<>();
for (Issue issue: issues) { for (Issue issue: issues) {
count = count + 1; issueList.add(issue);
String issueUrl = "http://jira2.quantgroup.cn/browse/" + issue.getKey(); }
content = content + count + "、[" + issue.getSummary().replace("\"", "") + "](" + issueUrl + ")\n"; if (issueList.size() > 0) {
content = content + "- 优先级:" + issue.getPriority().getName() + "\n"; int count = 0;
content = content + "- 状态:" + issue.getStatus().getName() + "\n"; for (Issue issue: issueList) {
String assignee = ""; count = count + 1;
if (issue.getAssignee() == null) { String issueUrl = "http://jira2.quantgroup.cn/browse/" + issue.getKey();
assignee = "未分配"; content = content + count + "、[" + issue.getSummary().replace("\"", "") + "](" + issueUrl + ")\n";
} else { content = content + "- 优先级:" + issue.getPriority().getName() + "\n";
assignee = issue.getAssignee().getDisplayName(); content = content + "- 状态:" + issue.getStatus().getName() + "\n";
String assignee = "";
if (issue.getAssignee() == null) {
assignee = "未分配";
} else {
assignee = issue.getAssignee().getDisplayName();
}
content = content + "- 经办人:" + assignee + "\n";
DateTime startDate = issue.getCreationDate();
DateTime curDate = new DateTime();
int duration = calculateBugFixTime(startDate, curDate);
content += "- 持续时间:" + duration + "小时\n\n";
} }
content = content + "- 经办人:" + assignee + "\n"; content += "**截止当前,共有" + String.valueOf(count) + "个工单未解决,请对应经办人尽快跟进解决**";
DateTime startDate = issue.getCreationDate(); }
DateTime curDate = new DateTime(); if (issueList.size() == 0) {
int duration = calculateBugFixTime(startDate, curDate); content += "**截止当前,所有工单都已经解决完毕,产研小伙伴最给力了👍🏻**";
content += "- 持续时间:" + duration + "小时\n\n";
} }
content += "**截止当前,共有" + String.valueOf(count) + "个工单未解决,请对应经办人尽快跟进解决**";
return buildMarkdownMsg(title, content, true); return buildMarkdownMsg(title, content, true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment