|
|
@@ -137,31 +137,4 @@ public class LiveCompletionPointsTask {
|
|
|
log.error("发送完课通知失败, liveId={}, userId={}", liveId, userId, e);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 发送完课通知(通过WebSocket推送弹窗) - 旧版本(保留)
|
|
|
- */
|
|
|
- private void sendCompletionNotification(Long liveId, Long userId) {
|
|
|
- try {
|
|
|
- // 查询未领取的完课记录
|
|
|
- List<LiveCompletionPointsRecord> unreceivedRecords = completionPointsRecordService.getUserUnreceivedRecords(liveId, userId);
|
|
|
-
|
|
|
- if (unreceivedRecords != null && !unreceivedRecords.isEmpty()) {
|
|
|
- // 构造弹窗消息
|
|
|
- SendMsgVo sendMsgVo = new SendMsgVo();
|
|
|
- sendMsgVo.setLiveId(liveId);
|
|
|
- sendMsgVo.setUserId(userId);
|
|
|
- sendMsgVo.setCmd("completionPoints");
|
|
|
- sendMsgVo.setMsg("完成任务!");
|
|
|
- sendMsgVo.setData(JSONObject.toJSONString(unreceivedRecords.get(0)));
|
|
|
-
|
|
|
- // 通过WebSocket发送给特定用户(调用已有的发送方法)
|
|
|
- webSocketServer.sendCompletionPointsMessage(liveId, userId, sendMsgVo);
|
|
|
-
|
|
|
- log.info("发送完课积分弹窗通知成功, liveId={}, userId={}", liveId, userId);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("发送完课通知失败, liveId={}, userId={}", liveId, userId, e);
|
|
|
- }
|
|
|
- }
|
|
|
}
|