| | |
| | | import java.nio.file.Paths; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | commonFileMapper.deleteById(fileId); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean deleteRepairAndFiles(Collection<Long> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | throw new ServiceException("删除失败,请传入要删除的数据"); |
| | | } |
| | | |
| | | List<CommonFile> fileList = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .in(CommonFile::getCommonId, ids) |
| | | .eq(CommonFile::getType, FileNameType.EQUIPMENT_WARRANTY.getValue())); |
| | | for (CommonFile commonFile : fileList) { |
| | | deleteFile(commonFile.getId()); |
| | | } |
| | | return this.removeBatchByIds(ids); |
| | | } |
| | | } |