no
DESKTOP-71BH0QO\L、ming
2021-04-29 c907ed8ec336fb2341c01d08d8cc240457a9fd08
no
1个文件已修改
28 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -111,12 +111,12 @@
        //查询邻里圈详情
        ComActNeighborCircleDetailAppVO circleDetailAppVO = this.baseMapper.neighborDetailByApp(neighborCircleAppDTO.getCircleId());
        //查询邻里圈下评论列表
        IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = comActNeighborCircleCommentDAO.pageNeighborCommentByApp(
        IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = neighborCircleCommentDAO.pageNeighborCommentByApp(
                new Page(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO);
        if(!circleCommentAppPage.getRecords().isEmpty()){
            for (ComActNeighborCircleCommentAppVO circleCommentVo:circleCommentAppPage.getRecords()) {
                //查询评论下评论回复
                List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = comActNeighborCircleCommentReplyDAO.getCircleCommentReplyList(circleCommentVo.getId());
                List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = neighborCircleCommentReplyDAO.getCircleCommentReplyList(circleCommentVo.getId());
                if(!commentReplyAppVOS.isEmpty()){
                    circleCommentVo.setCircleCommentReplyAppList(commentReplyAppVOS);
                }
@@ -209,22 +209,22 @@
            comActNeighborCircleBrowseService.addBrowseRecord(fabulousAppDTO.getServiceId(),fabulousAppDTO.getUserId());
        }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){
            //增加邻里圈评论点赞数量
            ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId());
            ComActNeighborCircleCommentDO circleCommentDO = neighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId());
            if(circleCommentDO != null){
                circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1);
                comActNeighborCircleCommentDAO.updateById(circleCommentDO);
                neighborCircleCommentDAO.updateById(circleCommentDO);
                circleFabulousDO.setCircleId(circleCommentDO.getCircleId());
            }
        }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){
            //增加邻里圈评论回复点赞数量
            ComActNeighborCircleCommentReplyDO circleCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId());
            ComActNeighborCircleCommentReplyDO circleCommentReplyDO = neighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId());
            if(circleCommentReplyDO != null){
                circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() + 1);
                comActNeighborCircleCommentReplyDAO.updateById(circleCommentReplyDO);
                neighborCircleCommentReplyDAO.updateById(circleCommentReplyDO);
                circleFabulousDO.setCircleId(circleCommentReplyDO.getCircleId());
            }
        }
        if(comActNeighborCircleFabulousDAO.insert(circleFabulousDO) > 0){
        if(neighborCircleFabulousDAO.insert(circleFabulousDO) > 0){
            return R.ok();
        }else{
            return R.fail("点赞失败");
@@ -281,7 +281,7 @@
            circleCommentDO.setIsRelease(ComActNeighborCircleCommentDO.isRelease.yes);
        }
        if(comActNeighborCircleCommentDAO.insert(circleCommentDO) > 0){
        if(neighborCircleCommentDAO.insert(circleCommentDO) > 0){
            return R.ok();
        }else{
            return R.fail("评论失败");
@@ -316,7 +316,7 @@
        //判断回复类型
        if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.pl)){
            //查询评论信息
            ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(replyAppDTO.getServiceId());
            ComActNeighborCircleCommentDO circleCommentDO = neighborCircleCommentDAO.selectById(replyAppDTO.getServiceId());
            if(circleCommentDO != null){
                circleCommentReplyDO.setCommentId(replyAppDTO.getServiceId());
                circleCommentReplyDO.setParentId(0L);
@@ -324,7 +324,7 @@
            }
        }else if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.hf)){
            //查询上级回复信息
            ComActNeighborCircleCommentReplyDO parentCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(replyAppDTO.getServiceId());
            ComActNeighborCircleCommentReplyDO parentCommentReplyDO = neighborCircleCommentReplyDAO.selectById(replyAppDTO.getServiceId());
            if(parentCommentReplyDO != null){
                circleCommentReplyDO.setCommentId(parentCommentReplyDO.getCommentId());
                circleCommentReplyDO.setParentId(parentCommentReplyDO.getId());
@@ -332,7 +332,7 @@
            }
        }
        if(comActNeighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){
        if(neighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){
            return R.ok();
        }else{
            return R.fail("回复失败");
@@ -349,15 +349,15 @@
            //遍历查询到的邻里圈,更新邻里圈内近3天的评论数,点赞数,浏览量
            for (ComActNeighborCircleDO neighborCircleDO:circleDOList) {
                //查询邻里圈近3天的评论数
                int commentCount = comActNeighborCircleCommentDAO.selectCount(
                int commentCount = neighborCircleCommentDAO.selectCount(
                        new QueryWrapper<ComActNeighborCircleCommentDO>().lambda().eq(ComActNeighborCircleCommentDO::getCircleId,neighborCircleDO.getId()));
                //查询邻里圈近3天的评论回复数
                int commentReplyCount = comActNeighborCircleCommentReplyDAO.selectCount(
                int commentReplyCount = neighborCircleCommentReplyDAO.selectCount(
                        new QueryWrapper<ComActNeighborCircleCommentReplyDO>().lambda()
                                .eq(ComActNeighborCircleCommentReplyDO::getCircleId,neighborCircleDO.getId()));
                //查询邻里圈近3天的点赞数
                int fabulousCount = comActNeighborCircleFabulousDAO.selectCount(new QueryWrapper<ComActNeighborCircleFabulousDO>()
                int fabulousCount = neighborCircleFabulousDAO.selectCount(new QueryWrapper<ComActNeighborCircleFabulousDO>()
                        .lambda().eq(ComActNeighborCircleFabulousDO::getCircleId,neighborCircleDO.getId())
                        .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes));