huanghongfa
2021-04-30 9f2153c7d97b375f0a9913beed65350d1e9fc0c4
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -636,4 +636,30 @@
        }
        return R.ok();
    }
    /**
     * 分页查询评论下所有回复
     * @param commentReplyAppDTO    请求参数
     * @return  回复列表
     */
    @Override
    public R neighborCommentReplyByApp(ComActNeighborCommentReplyAppDTO commentReplyAppDTO){
        IPage<ComActNeighborCommentReplyAppVO> neighborCircleIPage = this.baseMapper.neighborCommentReplyByApp(
                new Page<>(commentReplyAppDTO.getPageNum(),commentReplyAppDTO.getPageSize()),commentReplyAppDTO.getCommentId());
        if(!neighborCircleIPage.getRecords().isEmpty()){
            for (ComActNeighborCommentReplyAppVO commentReplyAppVO:neighborCircleIPage.getRecords()) {
                //查询点赞信息
                ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne(
                        new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,commentReplyAppVO.getId())
                                .eq(ComActNeighborCircleFabulousDO::getUserId,commentReplyAppDTO.getUserId())
                                .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.hf));
                if(circleFabulousDO != null && circleFabulousDO.getIsEffective().equals(ComActNeighborCircleFabulousDO.isEffective.yes)){
                    commentReplyAppVO.setHaveSign(1);
                }else{
                    commentReplyAppVO.setHaveSign(2);
                }
            }
        }
        return R.ok(neighborCircleIPage);
    }
}