Compare commits

..

No commits in common. "bad2cbc494771ccd05fa951e5e6eecf8238c0642" and "b1ab0a0670d11ed30ebeeccffd758513e93de3a2" have entirely different histories.

6 changed files with 12 additions and 7 deletions

View File

@ -695,7 +695,7 @@ public class CommonService {
fileName, fileName,
destPath, destPath,
strategyStr, strategyStr,
Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileName).orElse("") + "." + suffix); finalEdFileInfo.getFileName() + "." + suffix);
return ElectromagneticResultUtil.success(Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getId).orElse("")); return ElectromagneticResultUtil.success(Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getId).orElse(""));
} }

View File

@ -299,7 +299,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
String fileSysPath = commonService.getFileSysPath(id); String fileSysPath = commonService.getFileSysPath(id);
String dbPath = commonService.getDbPath(fileInfo.getFilePath()); String dbPath = commonService.getDbPath(fileInfo.getFilePath());
try { try {
Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在"); Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在,路径为 {}", dbPath);
FileSystemResource fileSystemResource = new FileSystemResource(fileSysPath); FileSystemResource fileSystemResource = new FileSystemResource(fileSysPath);
fileName = fileSystemResource.getFilename(); fileName = fileSystemResource.getFilename();
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
@ -1351,7 +1351,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
} catch (Exception e) { } catch (Exception e) {
String info = StrFormatter.format("文件预览错误文件id是--->{},错误信息--->{}", id, e.getMessage()); String info = StrFormatter.format("文件预览错误文件id是--->{},错误信息--->{}", id, e.getMessage());
log.error(info, e); log.error(info, e);
throw new BizException("文件预览错误文件id是 " + id); throw new BizException(info);
} finally { } finally {
FileUtil.del(fileSaveTmpPath); FileUtil.del(fileSaveTmpPath);
} }

View File

@ -94,7 +94,7 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId); EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId);
String dbPath = commonService.getDbPath(fileInfo.getFilePath()); String dbPath = commonService.getDbPath(fileInfo.getFilePath());
UserThreadLocal.setSuccessInfo(Optional.of(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签 {} 到文件 {}", tags, dbPath); UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签 {} 到文件 {}", tags, dbPath);
} }
return isSuccess; return isSuccess;
} }

View File

@ -155,7 +155,11 @@ public class PermissionServiceImpl implements PermissionService {
allCodes = FilePermission.getAllCodesExcludeView(); allCodes = FilePermission.getAllCodesExcludeView();
} }
for (String code : allCodes) { for (String code : allCodes) {
result.put(code, permissionCodes.contains(code)); if (permissionCodes.contains(code)) {
result.put(code, true);
} else {
result.put(code, false);
}
} }
return result; return result;
} }

View File

@ -245,7 +245,7 @@ public class BackupTask {
} }
DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), -1); DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), -1);
List<File> files = FileUtil.loopFiles(elePropertyConfig.getSqlDirs(), file -> file.lastModified() < dateTime.getTime()); List<File> files = FileUtil.loopFiles(sqlScript, file -> file.lastModified() < dateTime.getTime());
files.forEach(file -> { files.forEach(file -> {
boolean deleteSuccess = file.delete(); boolean deleteSuccess = file.delete();
String success = deleteSuccess ? "success" : "fail"; String success = deleteSuccess ? "success" : "fail";
@ -253,6 +253,7 @@ public class BackupTask {
log.info(msg); log.info(msg);
}); });
} catch (Exception e) { } catch (Exception e) {
log.warn("导出MySQL数据异常原因 {}", e.getMessage(), e); log.warn("导出MySQL数据异常原因 {}", e.getMessage(), e);
} }

View File

@ -98,7 +98,7 @@ public final class EleCommonUtil {
aes.decrypt(inputStream, outputStream, true); aes.decrypt(inputStream, outputStream, true);
} }
} catch (Exception e) { } catch (Exception e) {
String info = "文件加/解密失败"; String info = "文件加密失败";
log.error(info, e); log.error(info, e);
throw new BizException(info); throw new BizException(info);
} finally { } finally {