| | |
| | | import com.ruoyi.service.ZAutobiographyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public List<ZAutobiography> selectAutobiographyList(Long userId) { |
| | | LambdaQueryWrapper<ZAutobiography> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZAutobiography::getUserId,userId); |
| | | return list(lqw); |
| | | List<ZAutobiography> result = list(lqw); |
| | | result.forEach(zAutobiography -> { |
| | | if (zAutobiography.getAgeBegin() == null){ |
| | | throw new RuntimeException("有数据的起始年龄没有填"); |
| | | } |
| | | }); |
| | | return result.stream().sorted(Comparator.comparingInt(z -> Integer.parseInt(z.getAgeBegin()))).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |