| | |
| | | return tree; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listDetailBybomId(Integer bomId) { |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId); |
| | | Map<String, ProductStructureDto> distinctMap = new LinkedHashMap<>(); |
| | | for (ProductStructureDto dto : list) { |
| | | if (dto.getParentId() == null || dto.getParentId() == 0) { |
| | | continue; |
| | | } |
| | | String key = dto.getProcessId() == null ? "NULL_PROCESS_" + dto.getId() : String.valueOf(dto.getProcessId()); |
| | | distinctMap.putIfAbsent(key, dto); |
| | | } |
| | | return new ArrayList<>(distinctMap.values()); |
| | | } |
| | | |
| | | } |