| | |
| | | public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) { |
| | | Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO); |
| | | doPager.getRecords().forEach(data->{ |
| | | if(data.getUserType()!=1){ |
| | | data.setReleaseName(data.getCommunityName()); |
| | | } |
| | | }); |
| | | return R.ok(doPager); |
| | | } |
| | | |
| | |
| | | circleFabulousDO.setParentId(fabulousAppDTO.getServiceId()); |
| | | //判断点赞类型 |
| | | if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.llq)){ |
| | | |
| | | ComActNeighborCircleFabulousDO oldCircleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborFabulousAppDTO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(oldCircleFabulousDO != null){ |
| | | return R.fail("您已点赞"); |
| | | } |
| | | |
| | | //增加邻里圈点赞数量 |
| | | ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId()); |
| | | if(neighborCircleDO != null){ |
| | |
| | | //添加邻里圈浏览记录 |
| | | comActNeighborCircleBrowseService.addBrowseRecord(fabulousAppDTO.getServiceId(),fabulousAppDTO.getUserId()); |
| | | }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){ |
| | | ComActNeighborCircleFabulousDO oldCircleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborFabulousAppDTO.type.pl) |
| | | .eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(oldCircleFabulousDO != null){ |
| | | return R.fail("您已点赞"); |
| | | } |
| | | //增加邻里圈评论点赞数量 |
| | | ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if(circleCommentDO != null){ |
| | |
| | | circleFabulousDO.setCircleId(circleCommentDO.getCircleId()); |
| | | } |
| | | }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){ |
| | | ComActNeighborCircleFabulousDO oldCircleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborFabulousAppDTO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(oldCircleFabulousDO != null){ |
| | | return R.fail("您已点赞"); |
| | | } |
| | | //增加邻里圈评论回复点赞数量 |
| | | ComActNeighborCircleCommentReplyDO circleCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId()); |
| | | if(circleCommentReplyDO != null){ |
| | |
| | | //邻里圈浏览器记录 |
| | | neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>() |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId, id)); |
| | | //邻里圈点赞删除 需要一层一层删 |
| | | /* neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>() |
| | | .eq(ComActNeighborCircleFabulousDO::get))*/ |
| | | //邻里圈点赞删除 |
| | | neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>() |
| | | .eq(ComActNeighborCircleFabulousDO::getCircleId,id)); |
| | | return R.ok(); |
| | | |
| | | } |
| | |
| | | circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getUserId,fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq)); |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(circleFabulousDO == null){ |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | |
| | | circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getUserId,fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.pl)); |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.pl) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(circleFabulousDO == null){ |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | |
| | | circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | | new QueryWrapper<ComActNeighborCircleFabulousDO>().lambda().eq(ComActNeighborCircleFabulousDO::getParentId,fabulousAppDTO.getServiceId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getUserId,fabulousAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.hf)); |
| | | .eq(ComActNeighborCircleFabulousDO::getType,ComActNeighborCircleFabulousDO.type.hf) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if(circleFabulousDO == null){ |
| | | return R.fail("未查询到点赞信息"); |
| | | } |
| | |
| | | } |
| | | 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); |
| | | } |
| | | } |