From d468ff4afaed47caec1217d72763fdc679e7bddc Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 24 六月 2026 16:42:27 +0800
Subject: [PATCH] feat: 新增售后消息推送、售后数量自定义
---
src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java b/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
index 3de2b9e..01604ef 100644
--- a/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
+++ b/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,61 @@
} 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);
+ }
+
+ /**
+ * 鍙戦�佺洿鎺ヨ矾鐢辨帹閫侊紙涓嶇粡杩嘢ysNotice琛級
+ */
+ public void sendDirectRoutingPushToUser(Long userId, String title, String content, String webPath) {
+ SysUserClient client = userClientService.getById(userId);
+ if (client == null || StringUtils.isEmpty(client.getCid())) {
+ log.warn("鐢ㄦ埛 {} 鏈粦瀹氱Щ鍔ㄧ CID,璺宠繃鐩存帴鎺ㄩ��", userId);
+ return;
+ }
+ String appPath = convertWebPathToAppPath(webPath);
+ sendRoutingPush(
+ System.currentTimeMillis(),
+ client.getCid(),
+ title,
+ content,
+ appPath,
+ 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 +189,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);
--
Gitblit v1.9.3