| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | ComActDiscussDO comActDiscussDO1 = comActDiscussDAO.selectOne(new QueryWrapper<ComActDiscussDO>().lambda().eq(ComActDiscussDO::getDiscussSubject, comActDiscussDTO.getDiscussSubject()).eq(ComActDiscussDO::getUserId, comActDiscussDTO.getUserId()).last(" order by create_at desc limit 1 ")); |
| | | Long comActDiscussDO1Id = comActDiscussDO1.getId(); |
| | | Integer type = comActDiscussDTO.getType(); |
| | | if (type.intValue()==2) { |
| | | List<String> discussOptions = comActDiscussDTO.getDiscussOptions(); |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDTO> discussOptions = comActDiscussDTO.getDiscussOptions(); |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS=new ArrayList<>(); |
| | | discussOptions.forEach(s -> { |
| | | ComActDiscussOptionDO comActDiscussOptionDO=new ComActDiscussOptionDO(); |
| | | comActDiscussOptionDO.setDiscussId(comActDiscussDO1Id); |
| | | comActDiscussOptionDO.setOptionContent(s); |
| | | comActDiscussOptionDO.setOptionContent(s.getOptionContent()); |
| | | comActDiscussOptionDO.setOptionUrl(s.getOptionUrl()); |
| | | comActDiscussOptionDOS.add(comActDiscussOptionDO); |
| | | }); |
| | | comActDiscussOptionService.saveBatch(comActDiscussOptionDOS); |
| | |
| | | Integer integer1 = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, id)); |
| | | comActDiscussVO.setSignNum(integer1); |
| | | Integer type = comActDiscussVO.getType(); |
| | | if (type.intValue()==2) { |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList(new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id)); |
| | | List<ComActDiscussOptionVO> comActDiscussOptionVOS=new ArrayList<>(); |
| | | comActDiscussOptionDOS.forEach(comActDiscussOptionDO -> { |
| | |
| | | comActDiscussOptionVO.setNum(selectCount); |
| | | comActDiscussOptionVOS.add(comActDiscussOptionVO); |
| | | }); |
| | | comActDiscussOptionVOS.sort(Comparator.comparing(ComActDiscussOptionVO::getNum).reversed()); |
| | | comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionVOS); |
| | | } |
| | | Long userId = comActDiscussDO.getUserId(); |
| | |
| | | records.forEach(comActDiscussVO -> { |
| | | Integer type = comActDiscussVO.getType(); |
| | | Long id = comActDiscussVO.getId(); |
| | | if (type.intValue()==2) { |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList(new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id)); |
| | | List<ComActDiscussOptionVO> comActDiscussOptionVOS=new ArrayList<>(); |
| | | comActDiscussOptionDOS.forEach(comActDiscussOptionDO -> { |
| | |
| | | comActDiscussOptionVO.setNum(selectCount); |
| | | comActDiscussOptionVOS.add(comActDiscussOptionVO); |
| | | }); |
| | | comActDiscussOptionVOS.sort(Comparator.comparing(ComActDiscussOptionVO::getNum).reversed()); |
| | | comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionVOS); |
| | | } |
| | | Integer integer = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, comActDiscussVO.getId()).eq(ComActDiscussUserDO::getUserId, loginUserId)); |
| | |
| | | Integer integer1 = comActDiscussUserDAO.selectCount(new QueryWrapper<ComActDiscussUserDO>().lambda().eq(ComActDiscussUserDO::getDiscussId, id)); |
| | | comActDiscussVO.setSignNum(integer1); |
| | | Integer type = comActDiscussVO.getType(); |
| | | if (type.intValue()==2) { |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList(new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id)); |
| | | List<ComActDiscussOptionVO> comActDiscussOptionVOS=new ArrayList<>(); |
| | | comActDiscussOptionDOS.forEach(comActDiscussOptionDO -> { |
| | |
| | | comActDiscussOptionVO.setNum(selectCount); |
| | | comActDiscussOptionVOS.add(comActDiscussOptionVO); |
| | | }); |
| | | comActDiscussOptionVOS.sort(Comparator.comparing(ComActDiscussOptionVO::getNum).reversed()); |
| | | comActDiscussVO.setComActDiscussOptionVOS(comActDiscussOptionVOS); |
| | | } |
| | | Long userId = comActDiscussDO.getUserId(); |