| | |
| | | public int sendTaskNotifyMessage(Long taskId, List<Long> userIds, Long excludeUserId) { |
| | | // 检查订阅消息开关 |
| | | if (!isSubscribeMessageEnabled()) { |
| | | log.info("订阅消息发送已关闭,跳过发送,taskId={}", taskId); |
| | | // log.info("订阅消息发送已关闭,跳过发送,taskId={}", taskId); |
| | | return 0; |
| | | } |
| | | if (taskId == null || userIds == null || userIds.isEmpty()) { |
| | | log.warn("发送微信任务通知参数不完整,taskId={}, userIds={}", taskId, userIds); |
| | | // log.warn("发送微信任务通知参数不完整,taskId={}, userIds={}", taskId, userIds); |
| | | return 0; |
| | | } |
| | | |
| | | // 查询任务信息 |
| | | SysTask task = sysTaskMapper.selectSysTaskByTaskId(taskId); |
| | | if (task == null) { |
| | | log.warn("微信通知失败,任务不存在,taskId={}", taskId); |
| | | // log.warn("微信通知失败,任务不存在,taskId={}", taskId); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | try { |
| | | WechatUtils.sendSubscribeMessage(accessToken, user.getOpenId(), templateId, page, data); |
| | | successCount++; |
| | | log.info("微信任务通知发送成功,taskId={}, userId={}, userName={}", taskId, userId, user.getUserName()); |
| | | // log.info("微信任务通知发送成功,taskId={}, userId={}, userName={}", taskId, userId, user.getUserName()); |
| | | } catch (Exception e) { |
| | | log.error("微信任务通知发送失败,taskId={}, userId={}", taskId, userId, e); |
| | | } |