| | |
| | | import com.sandu.common.file.impl.AliOssFileServiceImpl; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.AllUserInfoParam; |
| | | import com.sandu.ximon.admin.param.EditFileParam; |
| | | import com.sandu.ximon.admin.param.PlatformFilePermissionParam; |
| | |
| | | throw new BusinessException("删除时参数不能为空!"); |
| | | } |
| | | List<PlatformFile> platformFiles = listByIds(param.getFileIds()); |
| | | if (platformFiles == null && platformFiles.size() == 0) { |
| | | if (platformFiles == null || platformFiles.size() == 0) { |
| | | throw new BusinessException("未找到文件!"); |
| | | } |
| | | //删除关系 |
| | | boolean remove = platformFileUserService.remove(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | if (remove) { |
| | | //删除文件 |
| | | return removeByIds(param.getFileIds()); |
| | | |
| | | //获取关系 |
| | | List<PlatformFileUser> list = platformFileUserService.list(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | if (!list.isEmpty()) { |
| | | //删除关系 |
| | | platformFileUserService.remove(Wrappers.lambdaQuery(PlatformFileUser.class).in(PlatformFileUser::getFileId, param.getFileIds())); |
| | | } |
| | | return false; |
| | | //删除文件 |
| | | return removeByIds(param.getFileIds()); |
| | | } |
| | | |
| | | |
| | |
| | | List<PlatformFileListBo> platformFileListBos; |
| | | if (AdministratorEnums.ADMIN.getCode().equals(SecurityUtils.getUserDetails().getAdministratorType())) { |
| | | PageHelper.startPage(vo.getPageNo(), vo.getPageSize()); |
| | | platformFileListBos = baseMapper.fileLiet(keyword, null); |
| | | platformFileListBos = baseMapper.fileList(keyword, null); |
| | | } else { |
| | | List<PlatformFileUser> platformFileUsers = SpringContextHolder.getBean(PlatformFileUserService.class) |
| | | .list(Wrappers.lambdaQuery(PlatformFileUser.class).eq(PlatformFileUser::getUserId, SecurityUtils.getUserId())); |
| | | List<Long> fileIdList = platformFileUsers.stream().map(PlatformFileUser::getFileId).collect(Collectors.toList()); |
| | | |
| | | if (fileIdList.size() == 0) { |
| | | fileIdList.add(-1L); |
| | | } |
| | | PageHelper.startPage(vo.getPageNo(), vo.getPageSize()); |
| | | platformFileListBos = baseMapper.fileLiet(keyword, SecurityUtils.getUserId()); |
| | | platformFileListBos = baseMapper.fileList(keyword, fileIdList); |
| | | |
| | | } |
| | | return platformFileListBos; |
| | | } |