| | |
| | | @Transactional |
| | | public Boolean addProductStructureDto(ProductStructureDto dto) { |
| | | |
| | | Long bomId = dto.getBomId(); |
| | | Integer bomId = dto.getBomId(); |
| | | |
| | | // 将树扁平化 |
| | | List<ProductStructureDto> flatDtoList = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomId(Long bomId) { |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId); |
| | | public List<ProductStructureDto> listBybomId(Integer bomId) { |
| | | List<ProductStructureDto> list = productStructureMapper.listBybomId(bomId,false); |
| | | |
| | | Map<Long, ProductStructureDto> map = new HashMap<>(); |
| | | for (ProductStructureDto node : list) { |
| | |
| | | return tree; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomIdIsParent(Integer bomId) { |
| | | return productStructureMapper.listBybomId(bomId,true); |
| | | } |
| | | |
| | | @Override |
| | | public Long countBybomId(Integer bomId) { |
| | | ProductStructure productStructure = productStructureMapper.selectOne(new LambdaQueryWrapper<ProductStructure>() |
| | | .eq(ProductStructure::getBomId, bomId) |
| | | .isNull(ProductStructure::getParentId)); |
| | | if(productStructure != null){ |
| | | return productStructureMapper.selectCount(new LambdaQueryWrapper<ProductStructure>() |
| | | .eq(ProductStructure::getParentId, productStructure.getId())); |
| | | } |
| | | return 0L; |
| | | } |
| | | |
| | | } |