| | |
| | | if (type.equals(ComActDiscussVO.type.tp)) { |
| | | //查询选项列表 |
| | | List<ComActDiscussOptionVO> comActDiscussOptionList = comActDiscussOptionDAO.getDiscussOptionList(id); |
| | | comActDiscussOptionList.forEach(option -> { |
| | | if (option.getAllNum() ==null || option.getAllNum() == 0) { |
| | | option.setPercent(new BigDecimal(0)); |
| | | } else { |
| | | //占比 |
| | | BigDecimal percent = BigDecimal.valueOf(option.getNum()).divide(BigDecimal.valueOf(option.getAllNum()), 2, RoundingMode.HALF_UP) |
| | | .multiply(BigDecimal.valueOf(100)).setScale(0); |
| | | option.setPercent(percent); |
| | | } |
| | | }); |
| | | comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionList); |
| | | } |
| | | Long userId = comActDiscussDO.getUserId(); |
| | |
| | | //分页查询评论列表 |
| | | PageComActDiscussCommentDTO pageComActDiscussCommentDTO = new PageComActDiscussCommentDTO(); |
| | | BeanUtils.copyProperties(discussDetailDTO, pageComActDiscussCommentDTO); |
| | | IPage<ComActDiscussCommentVO> discussComments = comActDiscussDAO.pageDiscussCommentAdmin(new Page<>(pageComActDiscussCommentDTO.getPageNum(), pageComActDiscussCommentDTO.getPageSize()), pageComActDiscussCommentDTO); |
| | | IPage<ComActDiscussCommentVO> discussComments = comActDiscussDAO.pageDiscussCommentAdmin(new Page<>(pageComActDiscussCommentDTO.getPageNum(), |
| | | pageComActDiscussCommentDTO.getPageSize()), pageComActDiscussCommentDTO); |
| | | discussComments.getRecords().forEach(comment -> { |
| | | if (comment.getReplyNum() > 0) { |
| | | List<ComActDiscussCommentVO> childList = comActDiscussDAO.getDiscussCommentReplyList(comment.getId()); |
| | |
| | | if (type.equals(ComActDiscussVO.type.tp)) { |
| | | //查询选项列表 |
| | | List<ComActDiscussOptionVO> comActDiscussOptionList = comActDiscussOptionDAO.getDiscussOptionList(id); |
| | | comActDiscussOptionList.forEach(option -> { |
| | | if (option.getAllNum() ==null || option.getAllNum() == 0) { |
| | | option.setPercent(new BigDecimal(0)); |
| | | } else { |
| | | //占比 |
| | | BigDecimal percent = BigDecimal.valueOf(option.getNum()).divide(BigDecimal.valueOf(option.getAllNum()), 2, RoundingMode.HALF_UP) |
| | | .multiply(BigDecimal.valueOf(100)).setScale(0); |
| | | option.setPercent(percent); |
| | | } |
| | | }); |
| | | comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionList); |
| | | } |
| | | Long userId = comActDiscussDO.getUserId(); |