| | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public R addNeighborByAdmin(AddNeighborCircleAdminVO addVO) { |
| | | ComActNeighborCircleDO comActNeighborCircleDO = new ComActNeighborCircleDO(); |
| | | AdministratorsUserVO adminUser = this.baseMapper.selectUserByUserId(addVO.getUserId()); |
| | | if(adminUser==null){ |
| | | if (adminUser == null) { |
| | | return R.fail("请登录重试"); |
| | | } |
| | | comActNeighborCircleDO.setReleaseId(addVO.getUserId()); |
| | |
| | | @Override |
| | | public R changeStatusByAdmin(EditNeighborCircleAdminVO editVO) { |
| | | ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(editVO.getId()); |
| | | if(neighborCircleDO==null){ |
| | | if (neighborCircleDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | neighborCircleDO.setStatus(editVO.getStatus()); |
| | | neighborCircleDO.setRefuseReason(editVO.getRefuseReason()); |
| | | if(editVO.getRefuseReason()!=null){ |
| | | neighborCircleDO.setRefuseReason(editVO.getRefuseReason()); |
| | | } |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | return R.ok(); |
| | | } |
| | |
| | | .eq(ComActNeighborCircleCommentReplyDO::getCircleId, id)); |
| | | //邻里圈浏览器记录 |
| | | neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>() |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId,id)); |
| | | //邻里圈点赞删除 |
| | | neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>() |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId,id)); |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId, id)); |
| | | //邻里圈点赞删除 需要一层一层删 |
| | | /* neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>() |
| | | .eq(ComActNeighborCircleFabulousDO::get))*/ |
| | | return R.ok(); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborByAdmin(Long id) { |
| | | return null; |
| | | ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id); |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(comActNeighborCircleDO.getReleaseId()); |
| | | if (comActNeighborCircleDO == null) { |
| | | return R.fail("id有误"); |
| | | } |
| | | DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO(); |
| | | BeanUtils.copyProperties(comActNeighborCircleDO, vo); |
| | | vo.setReleaseName(user.getName()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborAllCommentByAdmin(DetailNeighborAllCommentByAdminDTO dto) { |
| | | ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(dto.getId()); |
| | | if (comActNeighborCircleDO == null) { |
| | | return R.fail("id有误"); |
| | | } |
| | | Page<ComActNeighborCircleCommentDO> page = new Page<>(dto.getPageNum(),dto.getPageSize()); |
| | | //1、先查询所有该邻里圈_的评论 |
| | | IPage<ComActNeighborCommentByAdminVO> commentDOIPage = neighborCircleCommentDAO.selectPageDetailNeighborComment(page,dto); |
| | | return R.ok(commentDOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R changeCommentStatusByAdmin(ChangeCommentStatusByAdminVO dto) { |
| | | ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(dto.getId()); |
| | | if(commentDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | commentDO.setStatus(dto.getStatus()); |
| | | neighborCircleCommentDAO.updateById(commentDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentByAdmin(Long id) { |
| | | ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(id); |
| | | if(commentDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(commentDO.getUserId()); |
| | | ComActNeighborCommentByAdminVO vo = new ComActNeighborCommentByAdminVO(); |
| | | BeanUtils.copyProperties(commentDO,vo); |
| | | vo.setUserName(user.getName()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentAllReply(DetailNeighborCommentReplyByAdminDTO dto) { |
| | | Page<ComActNeighborCircleCommentReplyDO> page = new Page<>(dto.getPageNum(),dto.getPageSize()); |
| | | Page<ComActNeighborCommentReplyByAdminVO> replyPage = neighborCircleCommentReplyDAO.selectListByComment(page, dto); |
| | | replyPage.getRecords().forEach(reply->{ |
| | | |
| | | }); |
| | | return R.ok(replyPage); |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborCommentReply(Long id) { |
| | | ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(id); |
| | | if(replyDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | AdministratorsUserVO user = this.baseMapper.selectUserByUserId(replyDO.getUserId()); |
| | | ComActNeighborCommentReplyByAdminVO vo = new ComActNeighborCommentReplyByAdminVO(); |
| | | BeanUtils.copyProperties(replyDO,vo); |
| | | vo.setUserName(user.getName()); |
| | | vo.setUserPhone(user.getPhone()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) { |
| | | ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(changeStatusReplyVO.getId()); |
| | | if(replyDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | replyDO.setStatus(changeStatusReplyVO.getStatus()); |
| | | neighborCircleCommentReplyDAO.updateById(replyDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |