gongchunyi
昨天 8f8dfdeaf4469cd4f71178b0d037d1599186a479
src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
@@ -80,16 +80,19 @@
                log.warn("用户 {} 未绑定移动端 CID,跳过推送", sysNotice.getConsigneeId());
                continue;
            }
            // 转换路径
            String appPath = convertWebPathToAppPath(sysNotice.getJumpPath());
            String content = sysNotice.getNoticeContent();
            if (StringUtils.isNotEmpty(sysNotice.getRemark())) {
                content = content + " " + sysNotice.getRemark();
            }
            // 推送
            sendRoutingPush(
                    sysNotice.getNoticeId(),
                    client.getCid(),
                    sysNotice.getNoticeTitle(),
                    sysNotice.getRemark() != null ? sysNotice.getRemark() : sysNotice.getNoticeContent(),
                    content,
                    appPath
            );
        }
@@ -118,31 +121,41 @@
        } else {
            lastSegment = pathOnly;
        }
        if (StringUtils.isEmpty(lastSegment)) {
            return DEFAULT_APP_PAGE;
        }
        SysMenu menu = sysMenuMapper.selectMenuByPath(lastSegment);
        if (menu != null && StringUtils.isNotEmpty(menu.getAppComponent())) {
            String appPath = menu.getAppComponent();
            if (appPath.startsWith("/")) {
                appPath = appPath.substring(1);
            }
            //  拼接 Web 端原始参数并返回
            return appPath + queryString;
        }
        return DEFAULT_APP_PAGE;
    }
    /**
     * 发送回访提醒
     */
    public void sendReturnVisitReminder(Long returnVisitId, String cid, String content, Integer customerId) {
        String targetPath = "pages/cooperativeOffice/customerManage/detail?customerId=" + customerId;
        sendRoutingPush(returnVisitId, cid, "客户回访提醒", content, targetPath, false);
    }
    /**
     * 发送单人路由推送
     */
    private void sendRoutingPush(Long noticeId, String cid, String title, String content, String targetPath) {
        sendRoutingPush(noticeId, cid, title, content, targetPath, true);
    }
    /**
     * 发送单人路由推送
     */
    private void sendRoutingPush(Long noticeId, String cid, String title, String content, String targetPath, boolean needMarkRead) {
        log.info("准备推送消息:NoticeId={}, CID={}, Title={}, TargetPath={}", noticeId, cid, title, targetPath);
        PushDTO<Audience> pushDTO = new PushDTO<>();
@@ -156,6 +169,7 @@
        pushMessageMap.put("content", content);
        payloadMap.put("url", targetPath);
        payloadMap.put("noticeId", noticeId);
        payloadMap.put("needMarkRead", needMarkRead);
        pushMessageMap.put("payload", JSON.toJSONString(payloadMap));
        String transmissionContent = JSON.toJSONString(pushMessageMap);