fix: 为所有通知添加钉钉推送功能

问题:
1. 需求部门负责人收不到审核通知
2. 任务完结时发起者收不到通知
3. 所有通知都没有钉钉个人消息推送

修复内容:
1. TaskItemService - 添加5个通知的钉钉推送
   - 子任务被接单通知
   - 子任务组待审核通知
   - 流水线任务完成通知
   - 子任务被驳回通知
   - 子任务已指派通知

2. TaskService - 已完成(之前修复)
   - 任务待审核通知
   - 任务提交审核通知
   - 任务审核通过通知
   - 任务被驳回通知
   - 抢单成功通知

3. NotificationService便捷方法
   - sendNotification(receiverId, title, content, type, id)
   - 默认启用钉钉推送

现在所有通知都会:
✅ 发送站内通知
✅ 发送钉钉个人工作消息(如果用户绑定了钉钉ID)
This commit is contained in:
Your Name 2026-01-03 11:17:07 +08:00
parent 038659bd41
commit 6c50652df8

View File

@ -142,6 +142,7 @@ public class TaskItemService {
notification.setRelatedId(itemId);
notification.setRelatedType("task_item");
notification.setPriority(1); // 普通
notification.setPushDingtalk(1); // 推送到钉钉
notificationService.sendNotification(notification);
}
}
@ -279,6 +280,7 @@ public class TaskItemService {
notification.setRelatedId(item.getTaskId());
notification.setRelatedType("task");
notification.setPriority(2); // 重要
notification.setPushDingtalk(1); // 推送到钉钉
notificationService.sendNotification(notification);
log.info("已通知接单部门负责人(ID: {})审核第 {} 组子任务",
@ -318,6 +320,7 @@ public class TaskItemService {
notification.setRelatedId(mainTask.getId());
notification.setRelatedType("task");
notification.setPriority(1); // 普通
notification.setPushDingtalk(1); // 推送到钉钉
notificationService.sendNotification(notification);
}
@ -354,6 +357,7 @@ public class TaskItemService {
notification.setRelatedId(itemId);
notification.setRelatedType("task_item");
notification.setPriority(1); // 普通
notification.setPushDingtalk(1); // 推送到钉钉
notificationService.sendNotification(notification);
}
@ -438,6 +442,7 @@ public class TaskItemService {
notification.setRelatedId(taskId);
notification.setRelatedType("task");
notification.setPriority(2);
notification.setPushDingtalk(1); // 推送到钉钉
notificationService.sendNotification(notification);
log.info("第 {} 组 {} 个子任务已指派给设计师 {}", groupNo, groupItems.size(), receiver.getRealName());