| | |
| | | |
| | | 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; |
| | |
| | | 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()) { |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok(doPager); |
| | | } |
| | | |
| | | /** |
| | | * 用户发布邻里圈审核 |
| | | * |
| | |
| | | } |
| | | if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) { |
| | | neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); |
| | | } |
| | | //判断用户的话题是否是新增的 |
| | | if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getTopicName())){ |
| | | //新增邻里圈话题 |
| | | ComActNeighborCircleTopicDO circleTopicDO = comActNeighborCircleTopicMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicDO::getCommunityId,neighborCircleDO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicDO::getName,addNeighborCircleAppDTO.getTopicName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicDO(); |
| | | circleTopicDO.setCommunityId(neighborCircleDO.getCommunityId()); |
| | | circleTopicDO.setName(addNeighborCircleAppDTO.getTopicName()); |
| | | circleTopicDO.setCreateBy(neighborCircleDO.getReleaseId()); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCount(0); |
| | | circleTopicDO.setHotNum(0L); |
| | | circleTopicDO.setStatus(ComActNeighborCircleTopicDO.status.yes); |
| | | comActNeighborCircleTopicMapper.insert(circleTopicDO); |
| | | } |
| | | neighborCircleDO.setTopicId(circleTopicDO.getId()); |
| | | } |
| | | //判断当前邻里圈是否需要审核 |
| | | if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){ |
| | |
| | | |
| | | @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有误"); |
| | | } |
| | |
| | | } |
| | | 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)); |
| | | } |
| | | } |