优化代码。
This commit is contained in:
parent
dffa55ddef
commit
6cfe0691d2
|
|
@ -695,7 +695,7 @@ public class CommonService {
|
|||
fileName,
|
||||
destPath,
|
||||
strategyStr,
|
||||
finalEdFileInfo.getFileName() + "." + suffix);
|
||||
Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getFileName).orElse("") + "." + suffix);
|
||||
return ElectromagneticResultUtil.success(Optional.ofNullable(finalEdFileInfo).map(EdFileInfo::getId).orElse(""));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
|
|||
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId);
|
||||
String dbPath = commonService.getDbPath(fileInfo.getFilePath());
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签 {} 到文件 {}", tags, dbPath);
|
||||
UserThreadLocal.setSuccessInfo(Optional.of(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签 {} 到文件 {}", tags, dbPath);
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,11 +155,7 @@ public class PermissionServiceImpl implements PermissionService {
|
|||
allCodes = FilePermission.getAllCodesExcludeView();
|
||||
}
|
||||
for (String code : allCodes) {
|
||||
if (permissionCodes.contains(code)) {
|
||||
result.put(code, true);
|
||||
} else {
|
||||
result.put(code, false);
|
||||
}
|
||||
result.put(code, permissionCodes.contains(code));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ public class BackupTask {
|
|||
}
|
||||
|
||||
DateTime dateTime = DateUtil.offsetDay(DateUtil.date(), -1);
|
||||
List<File> files = FileUtil.loopFiles(sqlScript, file -> file.lastModified() < dateTime.getTime());
|
||||
List<File> files = FileUtil.loopFiles(elePropertyConfig.getSqlDirs(), file -> file.lastModified() < dateTime.getTime());
|
||||
files.forEach(file -> {
|
||||
boolean deleteSuccess = file.delete();
|
||||
String success = deleteSuccess ? "success" : "fail";
|
||||
|
|
@ -253,7 +253,6 @@ public class BackupTask {
|
|||
log.info(msg);
|
||||
});
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.warn("导出MySQL数据异常,原因 {}", e.getMessage(), e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue