From 37586eff875873eeed5c4ec999dde8c4567ea554 Mon Sep 17 00:00:00 2001
From: liujiming <liujm@wealthgrow.cn>
Date: Mon, 16 Aug 2021 15:11:47 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E6=B7=BB?=
 =?UTF-8?q?=E5=8A=A0=E8=AF=9D=E9=A2=98=E4=BF=A1=E6=81=AF=20fix?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../com/tanpu/community/api/beans/qo/ThemeNotifyQo.java     | 2 ++
 .../tanpu/community/dao/entity/NotificationForwardDO.java   | 2 ++
 .../main/java/com/tanpu/community/manager/ThemeManager.java | 2 +-
 .../com/tanpu/community/service/NotificationService.java    | 6 +++---
 .../src/main/java/com/tanpu/community/util/ConvertUtil.java | 4 +---
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java b/community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java
index 25781f2..7554401 100644
--- a/community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java
+++ b/community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeNotifyQo.java
@@ -49,6 +49,8 @@ public class ThemeNotifyQo {
     public String topicTitle;
     @ApiModelProperty(value = "评论/转发内容")
     private String content;
+    @ApiModelProperty(value = "转发类型-主题id")
+    private String forwardThemeId;
 
     @ApiModelProperty(value = "引用的主题id")
     public String formerThemeId;
diff --git a/community-service/src/main/java/com/tanpu/community/dao/entity/NotificationForwardDO.java b/community-service/src/main/java/com/tanpu/community/dao/entity/NotificationForwardDO.java
index 05fc7ce..1d49f67 100644
--- a/community-service/src/main/java/com/tanpu/community/dao/entity/NotificationForwardDO.java
+++ b/community-service/src/main/java/com/tanpu/community/dao/entity/NotificationForwardDO.java
@@ -15,4 +15,6 @@ public class NotificationForwardDO {
 
     private String topicId;
 
+    private String themeId;
+
 }
diff --git a/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java b/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
index 81274f8..42fea26 100644
--- a/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
+++ b/community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
@@ -414,7 +414,7 @@ public class ThemeManager {
             themeService.insertTheme(themeEntity);
             // 消息通知
             ThemeEntity formerTheme = themeService.queryByThemeId(req.getFormerThemeId());
-            notificationService.insertForward(userId, formerTheme.getAuthorId(), formerTheme.getThemeId(), req.getTopicId(), req.getContent().get(0).getValue());
+            notificationService.insertForward(userId, formerTheme.getAuthorId(), formerTheme.getThemeId(), req.getTopicId(), req.getContent().get(0).getValue(),themeEntity.getThemeId());
             notificationService.putNotifyCache(formerTheme.getAuthorId(),userId,NotificationTypeEnum.FORWARD);
 
         } else {
diff --git a/community-service/src/main/java/com/tanpu/community/service/NotificationService.java b/community-service/src/main/java/com/tanpu/community/service/NotificationService.java
index 99b9f12..c9eeda1 100644
--- a/community-service/src/main/java/com/tanpu/community/service/NotificationService.java
+++ b/community-service/src/main/java/com/tanpu/community/service/NotificationService.java
@@ -70,15 +70,15 @@ public class NotificationService {
     }
 
 
-    public void insertForward(String operatorId,String notifierId,String themeId,String topicId,String text){
-        NotificationForwardDO forwardDO = NotificationForwardDO.builder().topicId(topicId).content(text).build();
+    public void insertForward(String operatorId,String notifierId,String forwardThemeId,String topicId,String text,String themeId){
+        NotificationForwardDO forwardDO = NotificationForwardDO.builder().topicId(topicId).content(text).themeId(themeId).build();
         NotificationEntity entity = NotificationEntity.builder().operatorId(operatorId)
                 .notificationId(uuidGenHelper.getUuidStr())
                 .notifiedUserId(notifierId)
                 .messageType(NotificationTypeEnum.FORWARD.getCode())
                 .content(JsonUtil.toJson(forwardDO))
                 .operatorId(operatorId)
-                .targetId(themeId)
+                .targetId(forwardThemeId)
                 .build();
         insert(entity);
 
diff --git a/community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java b/community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
index 3b239cc..2f17276 100644
--- a/community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
+++ b/community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
@@ -259,12 +259,10 @@ public class ConvertUtil {
                     NotificationForwardDO forwardDO = JsonUtil.toBean(entity.getContent(), NotificationForwardDO.class);
                     themeNotifyQo.setContent(forwardDO.getContent());
                     themeNotifyQo.setTopicId(forwardDO.getTopicId());
+                    themeNotifyQo.setForwardThemeId(forwardDO.getThemeId());
                 }catch (Exception e){
                     throw new BizException("消息通知-转发类型-反序列化异常:"+ entity.getContent());
                 }
-
-
-
             }
         }
         // 点赞需要聚合头像和人数
-- 
2.18.1