| | |
| | | //查询邻里圈详情 |
| | | 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); |
| | | } |
| | |
| | | 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("点赞失败"); |
| | |
| | | circleCommentDO.setIsRelease(ComActNeighborCircleCommentDO.isRelease.yes); |
| | | } |
| | | |
| | | if(comActNeighborCircleCommentDAO.insert(circleCommentDO) > 0){ |
| | | if(neighborCircleCommentDAO.insert(circleCommentDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("评论失败"); |
| | |
| | | //判断回复类型 |
| | | 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); |
| | |
| | | } |
| | | }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()); |
| | |
| | | } |
| | | } |
| | | |
| | | if(comActNeighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){ |
| | | if(neighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("回复失败"); |
| | |
| | | //遍历查询到的邻里圈,更新邻里圈内近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)); |
| | | |