| | |
| | | /** 跳转路径 */
|
| | | private String jumpPath;
|
| | |
|
| | | /** APP跳转路径 */
|
| | | private String appJumpPath;
|
| | |
|
| | | /** 创建者 */
|
| | | @TableField(fill = FieldFill.INSERT)
|
| | | private String createBy;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void simpleNoticeByUser(String title, String message, List<Long> consigneeId, String jumpPath) {
|
| | | public void simpleNoticeByUser(String title, String message, List<Long> consigneeId, String jumpPath) {
|
| | | Long userId = SecurityUtils.getLoginUser().getUserId();
|
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId();
|
| | | List<SysNotice> sysNotices = consigneeId.stream().map(it -> convertSysNotice(title, message, it,tenantId, jumpPath, userId)).collect(Collectors.toList());
|
| | | List<SysNotice> sysNotices = consigneeId.stream()
|
| | | .map(it -> convertSysNotice(title, message, it, tenantId, jumpPath, unipushService.convertWebPathToAppPath(jumpPath), userId))
|
| | | .collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(sysNotices);
|
| | | try {
|
| | | unipushService.sendClientMessage(sysNotices);
|
| | |
| | | it.getUserId(),
|
| | | it.getTenantId(),
|
| | | jumpPath,
|
| | | unipushService.convertWebPathToAppPath(jumpPath),
|
| | | userId
|
| | | ))
|
| | | .collect(Collectors.toList());
|
| | |
| | | }
|
| | |
|
| | |
|
| | | private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,Long currentUserId) {
|
| | | private SysNotice convertSysNotice(String title,String message,Long consigneeId, Long tenantId,String jumpPath,String appJumpPath,Long currentUserId) {
|
| | | SysNotice sysNotice = new SysNotice();
|
| | | sysNotice.setNoticeType("1");
|
| | | sysNotice.setNoticeTitle(title);//标题
|
| | |
| | | sysNotice.setConsigneeId(consigneeId);
|
| | | sysNotice.setSenderId(currentUserId);
|
| | | sysNotice.setJumpPath(jumpPath);
|
| | | sysNotice.setAppJumpPath(appJumpPath);
|
| | | sysNotice.setTenantId(tenantId);
|
| | | return sysNotice;
|
| | | }
|
| | |
| | | /** |
| | | * 将 Web 端分层全路径转换为 App 端组件路由 |
| | | */ |
| | | private String convertWebPathToAppPath(String webPath) { |
| | | public String convertWebPathToAppPath(String webPath) { |
| | | if (StringUtils.isEmpty(webPath)) { |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | |
| | | sender_id, |
| | | consignee_id, |
| | | jump_path, |
| | | app_jump_path, |
| | | tenant_id |
| | | from sys_notice |
| | | </sql> |
| | |
| | | <if test="senderId != null and senderId != ''">sender_id,</if> |
| | | <if test="consigneeId != null and consigneeId != ''">consignee_id,</if> |
| | | <if test="jumpPath != null and jumpPath != ''">jump_path,</if> |
| | | <if test="appJumpPath != null and appJumpPath != ''">app_jump_path,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="tenantId != null and tenantId != ''">tenant_id,</if> |
| | | create_time |
| | |
| | | <if test="senderId != null and senderId != ''">#{senderId},</if> |
| | | <if test="consigneeId != null and consigneeId != ''">#{consigneeId},</if> |
| | | <if test="jumpPath != null and jumpPath != ''">#{jumpPath},</if> |
| | | <if test="appJumpPath != null and appJumpPath != ''">#{appJumpPath},</if> |
| | | <if test="pathParms != null and pathParms != ''">#{queryParms},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="tenantId != null and tenantId != ''">#{tenantId},</if> |