| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; |
| | | import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Slf4j |
| | | @Service |
| | | public abstract class ComActNeighborCircleServiceImpl extends ServiceImpl<ComActNeighborCircleDAO, ComActNeighborCircleDO> implements ComActNeighborCircleService { |
| | | @Resource |
| | | ComActNeighborCircleFabulousDAO neighborCircleFabulousDAO; |
| | | |
| | | @Resource |
| | | ComActNeighborCircleBrowseDAO neighborCircleBrowseDAO; |
| | | |
| | | @Resource |
| | | ComActNeighborCircleCommentDAO neighborCircleCommentDAO; |
| | | |
| | | @Resource |
| | | ComActNeighborCircleCommentReplyDAO neighborCircleCommentReplyDAO; |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | * |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO){ |
| | | public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO); |
| | | return R.ok(doPager); |
| | |
| | | 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()); |
| | |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteByAdmin(Long id) { |
| | | ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id); |
| | | if (comActNeighborCircleDO == null) { |
| | | return R.fail(); |
| | | } |
| | | if (comActNeighborCircleDO.getStatus() == 1) { |
| | | return R.fail("待审核的邻里圈不能删除"); |
| | | } |
| | | //邻里圈删除 |
| | | this.baseMapper.deleteById(id); |
| | | //邻里圈评论删除 |
| | | neighborCircleCommentDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleCommentDO>() |
| | | .eq(ComActNeighborCircleCommentDO::getCircleId, id)); |
| | | //邻里圈回复删除 |
| | | neighborCircleCommentReplyDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleCommentReplyDO>() |
| | | .eq(ComActNeighborCircleCommentReplyDO::getCircleId, id)); |
| | | //邻里圈浏览器记录 |
| | | neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>() |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId,id)); |
| | | //邻里圈点赞删除 |
| | | neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>() |
| | | .eq(ComActNeighborCircleBrowseDO::getNeighborId,id)); |
| | | /* neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>() |
| | | .eq(ComActNeighborCircleFabulousDO::get))*/ |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R detailNeighborByAdmin(Long id) { |
| | | return null; |
| | | } |
| | | } |