| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussCommentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussOptionVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDiscussVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.DiscussListVO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActDiscussOptionService; |
| | |
| | | } |
| | | List<ComActDiscussCommentVO> collect1 = records.stream().filter(comActDiscussCommentVO2 -> comActDiscussCommentVO2.getId().equals(parentId)).collect(Collectors.toList()); |
| | | if (!ObjectUtils.isEmpty(collect1)) { |
| | | String userName = collect1.get(0).getUserName(); |
| | | ComActDiscussCommentVO comActDiscussCommentVOFirst = collect1.get(0); |
| | | String userName = comActDiscussCommentVOFirst.getUserName(); |
| | | String userNickName = comActDiscussCommentVOFirst.getUserNickName(); |
| | | comActDiscussCommentVO1.setUserNameBack(userName); |
| | | comActDiscussCommentVO1.setUserNickNameBack(userNickName); |
| | | } |
| | | Integer integer = comActDiscussCommentUserDAO.selectCount(new QueryWrapper<ComActDiscussCommentUserDO>().lambda().eq(ComActDiscussCommentUserDO::getDisscussCommentId, comActDiscussCommentVO1.getId()).eq(ComActDiscussCommentUserDO::getUserId, pageComActDiscussCommentDTO.getLoginUserId())); |
| | | if (integer>0) { |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 工作大屏-一起议列表 |
| | | * @param discussListDTO 请求参数 |
| | | * @return 一起议列表 |
| | | */ |
| | | @Override |
| | | public R getScreenDiscussList(ScreenDiscussListDTO discussListDTO){ |
| | | IPage<DiscussListVO> discussListVOIPage = comActDiscussDAO.getScreenDiscussList(new Page(discussListDTO.getPageNum(),discussListDTO.getPageSize()),discussListDTO); |
| | | if(!discussListVOIPage.getRecords().isEmpty()){ |
| | | discussListVOIPage.getRecords().forEach(discussListVO -> { |
| | | //查询评论数量和点赞数量 |
| | | Integer integer = comActDiscussCommentDAO.selectCount(new QueryWrapper<ComActDiscussCommentDO>().lambda().eq(ComActDiscussCommentDO::getDiscussId, discussListVO.getId())); |
| | | discussListVO.setCommentCount(integer); |
| | | Integer integer1 = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, discussListVO.getId())); |
| | | discussListVO.setFabulousCount(integer1); |
| | | |
| | | if(discussListVO.getType().equals(ScreenDiscussListDTO.type.tp)){//投票 |
| | | List<ComActDiscussOptionVO> discussOptionList = comActDiscussDAO.getScreenDiscussOptionList(discussListVO.getId()); |
| | | if(!discussOptionList.isEmpty()){ |
| | | discussListVO.setDiscussOptionList(discussOptionList); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(discussListVOIPage); |
| | | } |
| | | } |