| | |
| | | public List<SvyCategoryVO> selectSvyCategoryList(SvyCategory svyCategory) { |
| | | List<SvyCategory> svyCategories = svyCategoryMapper.selectSvyCategoryList(svyCategory); |
| | | //将pid为空的,过滤掉 |
| | | svyCategories = svyCategories.stream().filter(assort -> assort.getPid() == null).collect(Collectors.toList()); |
| | | // svyCategories = svyCategories.stream().filter(assort -> assort.getPid() == null).collect(Collectors.toList()); |
| | | |
| | | List<SvyCategoryVO> svyCategoryVOS = DtoConversionUtils.sourceToTarget(svyCategories, SvyCategoryVO.class); |
| | | //遍历查出来的数据,通过 id=pid 获取他们的子数据 |
| | | for (SvyCategoryVO svyCategoryVO : svyCategoryVOS) { |
| | | if (svyCategoryVO.getPid() != null) { |
| | | continue; |
| | | } |
| | | // if (svyCategoryVO.getPid() != null) { |
| | | // continue; |
| | | // } |
| | | SvyCategory svyCategory1 = new SvyCategory(); |
| | | svyCategory1.setPid(svyCategoryVO.getId()); |
| | | List<SvyCategory> svyCategoryList = svyCategoryMapper.selectSvyCategoryList(svyCategory1); |