fix: 群通知使用简洁纯文本样式

- 移除所有emoji图标
- 使用简单横线分隔
- 类似星巴克标签的简洁风格
This commit is contained in:
Your Name 2026-01-03 19:03:59 +08:00
parent 88532d1857
commit 7f6bef38cb
2 changed files with 37 additions and 37 deletions

View File

@ -278,58 +278,58 @@ public class TaskApprovalService {
try {
String title = "新任务发布";
StringBuilder content = new StringBuilder();
content.append("━━━━━━━━━━━━━━━━ \n");
content.append("🎯 新 任 务 发 布 \n");
content.append("━━━━━━━━━━━━━━━━ \n\n");
content.append("-------------------------------- \n");
content.append(" 【 新 任 务 发 布 】 \n");
content.append("-------------------------------- \n\n");
// 基本信息
content.append("📋 任务名称:").append(task.getTitle()).append(" \n");
content.append("🔢 任务编号:").append(task.getTaskNo()).append(" \n");
content.append("⭐ 任务积分:").append(task.getScore()).append(" 分 \n");
content.append("任务名称:").append(task.getTitle()).append(" \n");
content.append("任务编号:").append(task.getTaskNo()).append(" \n");
content.append("任务积分:").append(task.getScore()).append(" 分 \n");
// 数量信息
if (task.getQuantity() != null && task.getQuantity() > 0) {
content.append("📦 任务数量:").append(task.getQuantity()).append(" 个 \n");
content.append("任务数量:").append(task.getQuantity()).append(" 个 \n");
}
content.append(" \n");
// 任务详情
if (task.getBrandName() != null && !task.getBrandName().isEmpty()) {
content.append("🏷️ 品牌:").append(task.getBrandName()).append(" \n");
content.append("品牌:").append(task.getBrandName()).append(" \n");
}
if (task.getCategoryName() != null && !task.getCategoryName().isEmpty()) {
content.append("📁 类目:").append(task.getCategoryName()).append(" \n");
content.append("类目:").append(task.getCategoryName()).append(" \n");
}
if (task.getPlatformName() != null && !task.getPlatformName().isEmpty()) {
content.append("💻 平台:").append(task.getPlatformName()).append(" \n");
content.append("平台:").append(task.getPlatformName()).append(" \n");
}
if (task.getSpuInfo() != null && !task.getSpuInfo().isEmpty()) {
content.append("📦 SPU:").append(task.getSpuInfo()).append(" \n");
content.append("SPU:").append(task.getSpuInfo()).append(" \n");
}
if (task.getTaskSubType() != null && !task.getTaskSubType().isEmpty()) {
content.append("📝 子类型:").append(task.getTaskSubType()).append(" \n");
content.append("子类型:").append(task.getTaskSubType()).append(" \n");
}
// 时间信息
if (task.getEstimatedHours() != null) {
content.append("⏱️ 预估工时:").append(task.getEstimatedHours().intValue()).append(" 小时(接单后开始计时) \n");
content.append("预估工时:").append(task.getEstimatedHours().intValue()).append(" 小时(接单后开始计时) \n");
}
content.append(" \n");
// 发起人信息
if (task.getPublisherName() != null && !task.getPublisherName().isEmpty()) {
content.append("👤 发起人:").append(task.getPublisherName()).append(" \n");
content.append("发起人:").append(task.getPublisherName()).append(" \n");
}
if (task.getPublisherDeptName() != null && !task.getPublisherDeptName().isEmpty()) {
content.append("🏢 发起部门:").append(task.getPublisherDeptName()).append(" \n");
content.append("发起部门:").append(task.getPublisherDeptName()).append(" \n");
}
content.append(" \n");
content.append("━━━━━━━━━━━━━━━━ \n");
content.append("💡 前往抢单:qd.yydd.ai \n");
content.append("━━━━━━━━━━━━━━━━");
content.append("-------------------------------- \n");
content.append("前往抢单:qd.yydd.ai \n");
content.append("--------------------------------");
log.info("准备调用钉钉机器人发送消息,title={}", title);
boolean success = dingTalkService.sendRobotMessage(title, content.toString());

View File

@ -517,57 +517,57 @@ public class TaskItemService {
try {
String title = "新子任务组发布";
StringBuilder content = new StringBuilder();
content.append("━━━━━━━━━━━━━━━━ \n");
content.append("🎯 新 子 任 务 组 发 布 \n");
content.append("━━━━━━━━━━━━━━━━ \n\n");
content.append("-------------------------------- \n");
content.append(" 【 新 子 任 务 组 发 布 】 \n");
content.append("-------------------------------- \n\n");
// 主任务信息
content.append("📋 主任务:").append(mainTask.getTitle()).append(" \n");
content.append("🔢 任务编号:").append(mainTask.getTaskNo()).append(" \n");
content.append("📦 任务组:第 ").append(groupNo).append(" 组 \n");
content.append("🔢 子任务数量:").append(groupItems.size()).append(" 个 \n");
content.append("主任务:").append(mainTask.getTitle()).append(" \n");
content.append("任务编号:").append(mainTask.getTaskNo()).append(" \n");
content.append("任务组:第 ").append(groupNo).append(" 组 \n");
content.append("子任务数量:").append(groupItems.size()).append(" 个 \n");
// 计算总积分
int totalScore = groupItems.stream().mapToInt(item -> item.getTotalScore() != null ? item.getTotalScore() : 0).sum();
content.append("⭐ 总积分:").append(totalScore).append(" 分 \n");
content.append("总积分:").append(totalScore).append(" 分 \n");
content.append(" \n");
// 任务详情
if (mainTask.getBrandName() != null && !mainTask.getBrandName().isEmpty()) {
content.append("🏷️ 品牌:").append(mainTask.getBrandName()).append(" \n");
content.append("品牌:").append(mainTask.getBrandName()).append(" \n");
}
if (mainTask.getCategoryName() != null && !mainTask.getCategoryName().isEmpty()) {
content.append("📁 类目:").append(mainTask.getCategoryName()).append(" \n");
content.append("类目:").append(mainTask.getCategoryName()).append(" \n");
}
if (mainTask.getPlatformName() != null && !mainTask.getPlatformName().isEmpty()) {
content.append("💻 平台:").append(mainTask.getPlatformName()).append(" \n");
content.append("平台:").append(mainTask.getPlatformName()).append(" \n");
}
if (mainTask.getSpuInfo() != null && !mainTask.getSpuInfo().isEmpty()) {
content.append("📦 SPU:").append(mainTask.getSpuInfo()).append(" \n");
content.append("SPU:").append(mainTask.getSpuInfo()).append(" \n");
}
content.append(" \n");
// 列出子任务详情
content.append("📝 子任务列表: \n");
content.append("子任务列表: \n");
for (TaskItem item : groupItems) {
content.append(" • ").append(item.getItemNo())
content.append(" - ").append(item.getItemNo())
.append("(").append(item.getTotalScore() != null ? item.getTotalScore() : 0).append("分) \n");
}
// 发起人信息
if (mainTask.getPublisherName() != null && !mainTask.getPublisherName().isEmpty()) {
content.append("👤 发起人:").append(mainTask.getPublisherName()).append(" \n");
content.append("发起人:").append(mainTask.getPublisherName()).append(" \n");
}
if (mainTask.getPublisherDeptName() != null && !mainTask.getPublisherDeptName().isEmpty()) {
content.append("🏢 发起部门:").append(mainTask.getPublisherDeptName()).append(" \n");
content.append("发起部门:").append(mainTask.getPublisherDeptName()).append(" \n");
}
content.append(" \n");
content.append("━━━━━━━━━━━━━━━━ \n");
content.append("💡 前往抢单:qd.yydd.ai \n");
content.append("━━━━━━━━━━━━━━━━");
content.append("-------------------------------- \n");
content.append("前往抢单:qd.yydd.ai \n");
content.append("--------------------------------");
dingTalkService.sendRobotMessage(title, content.toString());
log.info("第 {} 组 {} 个子任务已发布到任务大厅,已发送钉钉群通知", groupNo, groupItems.size());