huanghongfa
2021-08-10 63cdfcdab5b90e25dc468967c5e4ac0315965f02
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -85,6 +85,7 @@
        IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO);
        if(!doPager.getRecords().isEmpty()){
            for (ComActNeighborCircleAppVO circleAppVO:doPager.getRecords()) {
                if(neighborCircleAppDTO.getUserId() != null){
                //查询点赞信息
                ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne(
                        new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleAppVO.getId())
@@ -95,6 +96,7 @@
                    circleAppVO.setHaveSign(1);
                }else{
                    circleAppVO.setHaveSign(2);
                    }
                }
                if(circleAppVO.getType() != null && circleAppVO.getType().equals(ComActNeighborCircleDO.type.admin)){
@@ -156,6 +158,7 @@
            }
        }
        if(neighborCircleAppDTO.getUserId() != null){
        //查询邻里圈点赞信息
        ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne(
                new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleDetailAppVO.getId())
@@ -167,12 +170,16 @@
        }else{
            circleDetailAppVO.setHaveSign(2);
        }
        }
        //查询邻里圈下评论列表
        IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = comActNeighborCircleCommentDAO.pageNeighborCommentByApp(
                new Page(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO);
        if(!circleCommentAppPage.getRecords().isEmpty()){
            for (ComActNeighborCircleCommentAppVO circleCommentVo:circleCommentAppPage.getRecords()) {
                if(neighborCircleAppDTO.getUserId() != null){
                //查询点赞信息
                ComActNeighborCircleFabulousDO circleCommentFabulousDO = comActNeighborCircleFabulousDAO.selectOne(
                        new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,circleCommentVo.getId())
@@ -184,10 +191,13 @@
                }else{
                    circleCommentVo.setHaveSign(2);
                }
                }
                //查询评论下评论回复
                List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = comActNeighborCircleCommentReplyDAO.getCircleCommentReplyList(circleCommentVo.getId());
                if(!commentReplyAppVOS.isEmpty()){
                    List<ComActNeighborCircleCommentReplyAppVO> newCommentReplyAppVOS = new ArrayList<>();
                    if(neighborCircleAppDTO.getUserId() != null){
                    int i = 0;
                    for (ComActNeighborCircleCommentReplyAppVO commentReplyVO:commentReplyAppVOS) {
                        if(i >= 2){
@@ -206,6 +216,7 @@
                        }
                        newCommentReplyAppVOS.add(commentReplyVO);
                        i++;
                        }
                    }
                    circleCommentVo.setCircleCommentReplyAppList(newCommentReplyAppVOS);
                    circleCommentVo.setCommentReplyNum(commentReplyAppVOS.size());
@@ -377,8 +388,10 @@
    @Override
    public R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO){
        if(forwardAppDTO.getUserId() != null){
        //添加邻里圈浏览记录
        comActNeighborCircleBrowseService.addBrowseRecord(forwardAppDTO.getCircleId(),forwardAppDTO.getUserId());
        }
        ComActNeighborCircleDO circleDO = this.baseMapper.selectById(forwardAppDTO.getCircleId());
        if(circleDO == null){
@@ -735,6 +748,7 @@
                new Page<>(commentReplyAppDTO.getPageNum(),commentReplyAppDTO.getPageSize()),commentReplyAppDTO.getCommentId());
        if(!neighborCircleIPage.getRecords().isEmpty()){
            for (ComActNeighborCommentReplyAppVO commentReplyAppVO:neighborCircleIPage.getRecords()) {
                if(commentReplyAppDTO.getUserId() != null){
                //查询点赞信息
                ComActNeighborCircleFabulousDO circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne(
                        new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,commentReplyAppVO.getId())
@@ -748,6 +762,7 @@
                }
            }
        }
        }
        return R.ok(neighborCircleIPage);
    }
}