|
@@ -149,7 +149,7 @@ public class TaskCheckinWebhookReminderTask {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String content = buildContent(task, reminderPhase, offset, timing);
|
|
|
|
|
|
|
+ String content = buildContent(task, userId, reminderPhase, offset, timing);
|
|
|
NotificationMessage msg = new NotificationMessage(userId, NOTIFY_TYPE,
|
|
NotificationMessage msg = new NotificationMessage(userId, NOTIFY_TYPE,
|
|
|
"任务打卡提醒", content, REF_TYPE, task.getId(), channels);
|
|
"任务打卡提醒", content, REF_TYPE, task.getId(), channels);
|
|
|
dispatch(msg);
|
|
dispatch(msg);
|
|
@@ -198,11 +198,13 @@ public class TaskCheckinWebhookReminderTask {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 组装提醒文案(before=即将到期 / after=已超时) */
|
|
/** 组装提醒文案(before=即将到期 / after=已超时) */
|
|
|
- private String buildContent(Task task, String phase, int offsetMinutes, String timing) {
|
|
|
|
|
|
|
+ private String buildContent(Task task, Long userId, String phase, int offsetMinutes, String timing) {
|
|
|
String name = "您";
|
|
String name = "您";
|
|
|
try {
|
|
try {
|
|
|
- if (task.getExecutorId() != null) {
|
|
|
|
|
- User u = userMapper.selectById(task.getExecutorId());
|
|
|
|
|
|
|
+ // 昵称按接收人 userId 查(task.executor_id 是 family_members.id,
|
|
|
|
|
+ // 直接用它查 users 会命中同 id 的无关用户,如成员75误取users.id=75「用户1139」)
|
|
|
|
|
+ if (userId != null) {
|
|
|
|
|
+ User u = userMapper.selectById(userId);
|
|
|
if (u != null && u.getNickname() != null && !u.getNickname().isEmpty()) {
|
|
if (u != null && u.getNickname() != null && !u.getNickname().isEmpty()) {
|
|
|
name = u.getNickname();
|
|
name = u.getNickname();
|
|
|
}
|
|
}
|