| | |
| | | } |
| | | } |
| | | java.util.Map<Integer, String> relationNameMap = new java.util.HashMap<>(); |
| | | java.util.Map<Integer, String> relationOtherFieldMap = new java.util.HashMap<>(); |
| | | java.util.Map<Integer, String> relationRemarkMap = new java.util.HashMap<>(); |
| | | if (!relationIds.isEmpty()) { |
| | | categoryMapper.selectList(new QueryWrapper<Category>().lambda() |
| | | .in(Category::getId, relationIds) |
| | | .eq(Category::getDeleted, Constants.ZERO)) |
| | | .forEach(c -> relationNameMap.put(c.getId(), c.getName())); |
| | | .forEach(c -> { |
| | | relationNameMap.put(c.getId(), c.getName()); |
| | | relationOtherFieldMap.put(c.getId(), c.getOtherField()); |
| | | relationRemarkMap.put(c.getId(), c.getRemark()); |
| | | }); |
| | | } |
| | | for (Category category:categoryList) { |
| | | if(StringUtils.isNotBlank(category.getIcon())){ |
| | |
| | | } |
| | | if (category.getRelationId() != null) { |
| | | category.setRelationName(relationNameMap.get(category.getRelationId())); |
| | | category.setRelationOtherField(relationOtherFieldMap.get(category.getRelationId())); |
| | | category.setRelationRemark(relationRemarkMap.get(category.getRelationId())); |
| | | } |
| | | } |
| | | } |