doum
15 小时以前 11e35e0257e48667292b4f563ddf6ce02a3a22bb
server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java
@@ -95,9 +95,9 @@
            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());
@@ -275,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);
@@ -341,8 +342,11 @@
        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);
        }
        String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode();
        String memberFile = path + systemDictDataBiz.queryByCode(Constants.OSS, Constants.MEMBER_FILE).getCode();
        String commentFile = path + systemDictDataBiz.queryByCode(Constants.OSS, Constants.COMMENT_FILE).getCode();
@@ -372,7 +376,6 @@
                s.setReplyMemberNikeName(null);
            }
        });
        return PageData.from(result);
    }
}