| | |
| | | package com.ruoyi.project.system.service.impl;
|
| | |
|
| | | import java.time.LocalDateTime;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.project.system.domain.SysNotice;
|
| | | import com.ruoyi.project.system.mapper.SysNoticeMapper;
|
| | |
| | | @Autowired
|
| | | @Lazy
|
| | | private ISysNoticeService sysNoticeService;
|
| | |
|
| | | @Autowired
|
| | | private UnipushService unipushService;
|
| | |
|
| | | /**
|
| | | * 查询公告信息
|
| | |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId();
|
| | | List<SysNotice> sysNotices = consigneeId.stream().map(it -> convertSysNotice(title, message, it,tenantId, jumpPath, userId)).collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(sysNotices);
|
| | | try {
|
| | | unipushService.sendClientMessage(sysNotices);
|
| | | } catch (Exception e) {
|
| | | log.error("APP推送通知失败,原因: {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | .collect(Collectors.toList());
|
| | |
|
| | | sysNoticeService.saveBatch(collect);
|
| | | try {
|
| | | unipushService.sendClientMessage(collect);
|
| | | } catch (Exception e) {
|
| | | log.error("APP推送通知失败,原因: {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | sysNotice.setTenantId(tenantId);
|
| | | return sysNotice;
|
| | | }
|
| | |
|
| | | }
|