| | |
| | | import com.sandu.ximon.admin.param.PlatformFilePermissionParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.bo.PlatformFileListBo; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.domain.Admin; |
| | | import com.sandu.ximon.dao.domain.Client; |
| | | import com.sandu.ximon.dao.domain.PlatformFile; |
| | | import com.sandu.ximon.dao.domain.PlatformFileUser; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import com.sandu.ximon.dao.mapper.PlatformFileMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | 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(Wrappers.lambdaQuery(PlatformFileUser.class).eq(PlatformFileUser::getUserId, SecurityUtils.getUserId())); |
| | | List<Long> fileIdList = platformFileUsers.stream().map(PlatformFileUser::getFileId).collect(Collectors.toList()); |
| | | |
| | | if(fileIdList.size() == 0){ |
| | | if (fileIdList.size() == 0) { |
| | | fileIdList.add(-1L); |
| | | } |
| | | PageHelper.startPage(vo.getPageNo(), vo.getPageSize()); |