| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActNeighborCircleTopicMapper comActNeighborCircleTopicMapper; |
| | | |
| | | @Resource |
| | | private ComActNeighborCircleTopicService comActNeighborCircleTopicService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComPbMemberDAO comPbMemberDAO; |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | // if(neighborCircleAppDTO.getCommunityId()==0L){ |
| | | // R<LoginUserInfoVO> loginUserInfoVOR=userService.getUserInfoByUserId(neighborCircleAppDTO.getUserId().toString()); |
| | | // if(R.isOk(loginUserInfoVOR)){ |
| | | // LoginUserInfoVO loginUserInfoVO=loginUserInfoVOR.getData(); |
| | | // if(loginUserInfoVO!=null){ |
| | | // ComPbMemberDO comPbMemberDO=comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getIdCard,loginUserInfoVO.getIdCard())); |
| | | // if(comPbMemberDO!=null){ |
| | | // neighborCircleAppDTO.setCommunityId(comPbMemberDO.getCommunityId()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); |
| | | IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO); |
| | | if (!doPager.getRecords().isEmpty()) { |
| | |
| | | ComActDO actDO = comActDAO.selectById(circleAppVO.getCommunityId()); |
| | | if (actDO != null) { |
| | | circleAppVO.setName(actDO.getName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(doPager); |
| | | } |
| | | |
| | | @Override |
| | | public R selectSolve(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | IPage<ComActNeighborCircleAppVO> doPager=this.baseMapper.selectSolve(new Page<ComActNeighborCircleDO>(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO); |
| | | if (!doPager.getRecords().isEmpty()) { |
| | | for (ComActNeighborCircleAppVO circleAppVO : doPager.getRecords()) { |
| | | if (neighborCircleAppDTO.getSolveId() != null) { |
| | | // 查询点赞信息 |
| | | ComActNeighborCircleFabulousDO circleFabulousDO = |
| | | comActNeighborCircleFabulousDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousDO>() |
| | | .lambda().eq(ComActNeighborCircleFabulousDO::getParentId, circleAppVO.getId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getUserId, neighborCircleAppDTO.getUserId()) |
| | | .eq(ComActNeighborCircleFabulousDO::getType, ComActNeighborCircleFabulousDO.type.llq) |
| | | .eq(ComActNeighborCircleFabulousDO::getIsEffective, |
| | | ComActNeighborCircleFabulousDO.isEffective.yes)); |
| | | if (circleFabulousDO != null) { |
| | | circleAppVO.setHaveSign(1); |
| | | } else { |
| | | circleAppVO.setHaveSign(2); |
| | | } |
| | | } |
| | | ComActDO actDO = comActDAO.selectById(circleAppVO.getCommunityId()); |
| | | if (circleAppVO.getType() != null && circleAppVO.getType().equals(ComActNeighborCircleDO.type.admin)) { |
| | | if (actDO != null) { |
| | | circleAppVO.setName(actDO.getName()); |
| | | } |
| | | } |
| | | else { |
| | | if (actDO != null) { |
| | | circleAppVO.setCommunityName(actDO.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | 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()); |
| | | if(data.getUserType()!=null){ |
| | | if (data.getUserType() != 1) { |
| | | data.setReleaseName(data.getCommunityName()); |
| | | } |
| | | } |
| | | }); |
| | | return R.ok(doPager); |
| | |
| | | comActNeighborCircleDO.setLastCommentNum(0); |
| | | comActNeighborCircleDO.setLastFabulousNum(0); |
| | | comActNeighborCircleDO.setLastViewsNum(0); |
| | | comActNeighborCircleDO.setBelongType(addVO.getBelongType()); |
| | | this.baseMapper.insert(comActNeighborCircleDO); |
| | | return R.ok(); |
| | | } |
| | |
| | | public R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | IPage<ComActNeighborCircleAppVO> neighborCircleIPage = this.baseMapper.neighborExamineByApp( |
| | | new Page<>(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()), |
| | | neighborCircleAppDTO.getUserId()); |
| | | neighborCircleAppDTO.getUserId(),neighborCircleAppDTO.getBelongType()); |
| | | if (!neighborCircleIPage.getRecords().isEmpty()) { |
| | | for (ComActNeighborCircleAppVO circleAppVO : neighborCircleIPage.getRecords()) { |
| | | // 查询点赞信息 |
| | |
| | | |
| | | @Override |
| | | public R detailNeighborByAdmin(Long id) { |
| | | ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id); |
| | | ComActNeighborCircleDetailAppVO comActNeighborCircleDO = |
| | | this.baseMapper.neighborDetailByApp(id); |
| | | if (comActNeighborCircleDO == null) { |
| | | return R.fail("id有误"); |
| | | } |
| | |
| | | DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO(); |
| | | BeanUtils.copyProperties(comActNeighborCircleDO, vo); |
| | | vo.setReleaseName(user.getName()); |
| | | vo.setImageUrl(user.getImageUrl()); |
| | | |
| | | // 查询话题名称 |
| | | if (comActNeighborCircleDO.getTopicId() != null) { |
| | |
| | | BeanUtils.copyProperties(commentDO, vo); |
| | | String name = user.getName() == null ? user.getNickName() : user.getName(); |
| | | vo.setUserName(name); |
| | | vo.setUserPhone(user.getPhone()); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R orderAndSolve(EditNeighborCircleAdminVO editNeighborCircleAdminVO) { |
| | | ComActNeighborCircleDO comActNeighborCircleDO=new ComActNeighborCircleDO(); |
| | | BeanUtils.copyProperties(editNeighborCircleAdminVO,comActNeighborCircleDO); |
| | | if(comActNeighborCircleDO.getSolveStatus()!=null){ |
| | | comActNeighborCircleDO.setSolveTime(new Date()); |
| | | } |
| | | if(comActNeighborCircleDO.getOrderStatus()!=null){ |
| | | comActNeighborCircleDO.setOrderTime(new Date()); |
| | | } |
| | | return R.ok(this.baseMapper.updateById(comActNeighborCircleDO)); |
| | | } |
| | | } |