From 988b4e04541d15c7586efb72f565960b4de4c492 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期六, 28 二月 2026 16:11:44 +0800
Subject: [PATCH] 经销商管理

---
 server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java
index ddc8309..6512e54 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java
@@ -82,16 +82,22 @@
         target.setType(Constants.ZERO);
 
         if (comment.getReplyId() != null){
-            Comment reply = commentMapper.selectById(comment.getReplyId());
+            Comment reply = commentMapper.selectJoinOne(Comment.class,new MPJLambdaWrapper<Comment>()
+                    .selectAll(Comment.class)
+                    .selectAs(Member::getNickname,Comment::getReplyMemberNikeName)
+                    .leftJoin(Member.class,Member::getId,Comment::getMemberId)
+                    .eq(Comment::getId,comment.getReplyId())
+            );
             reply = Optional.ofNullable(reply).orElseThrow(() -> new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍥炲鐩爣涓嶅瓨鍦�"));
             target.setReplyId(reply.getId());
             target.setReplyMemberId(reply.getMemberId());
+            target.setReplyMemberNikeName(reply.getReplyMemberNikeName());
             target.setCommentId(reply.getId());
             target.setCommentMemberId(reply.getMemberId());
             target.setType(Constants.ONE);
-        }
-
-        if (comment.getCommentId() != null ){
+            target.setCommentId(reply.getCommentId());
+            target.setCommentMemberId(reply.getCommentMemberId());
+        }else if (comment.getCommentId() != null ){
             Comment reply = commentMapper.selectById(comment.getCommentId());
             reply = Optional.ofNullable(reply).orElseThrow(() -> new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "涓�绾ц瘎璁虹洰鏍囦笉瀛樺湪"));
             target.setCommentId(reply.getCommentId());
@@ -269,6 +275,7 @@
         replyWrapper.eq(Comment::getType, Constants.ONE);
         replyWrapper.eq(Comment::getStatus, Constants.ZERO);
         replyWrapper.in(Comment::getCommentId,commentIds);
+        replyWrapper.orderByDesc(Comment::getId);
         replyWrapper.groupBy(Comment::getCommentId);
 
         List<ActivityReplyCommentDTO> activityCommentDTOS = commentJoinMapper.selectJoinList(ActivityReplyCommentDTO.class, replyWrapper);
@@ -335,6 +342,7 @@
         queryWrapper.eq(Comment::getType, Constants.ONE);
         queryWrapper.eq(Comment::getStatus, Constants.ZERO);
         queryWrapper.eq(Comment::getCommentId,pageWrap.getModel().getCommentId());
+        queryWrapper.orderByDesc(Comment::getId);
         IPage<ActivityReplyCommentDTO> result = commentJoinMapper.selectJoinPage(page, ActivityReplyCommentDTO.class, queryWrapper);
         if (CollectionUtils.isEmpty(result.getRecords())){
             return PageData.from(result);
@@ -368,7 +376,6 @@
                 s.setReplyMemberNikeName(null);
             }
         });
-
         return PageData.from(result);
     }
 }

--
Gitblit v1.9.3