|
@@ -438,6 +438,7 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
FilePathVo filePathVo = filePathVoList.get(isFront ? 0 : 1);
|
|
FilePathVo filePathVo = filePathVoList.get(isFront ? 0 : 1);
|
|
|
|
|
|
outputFile = SystemConstant.getFileTempVar(filePathVo.getPath().substring(filePathVo.getPath().lastIndexOf(SystemConstant.ORG_POINT)));
|
|
outputFile = SystemConstant.getFileTempVar(filePathVo.getPath().substring(filePathVo.getPath().lastIndexOf(SystemConstant.ORG_POINT)));
|
|
|
|
+ log.warn("[图片旋转]临时文件路径:" + outputFile.getAbsolutePath());
|
|
ImageUtil.rotate(fileUploadService.downloadInputStream(filePathVo.getPath(), filePathVo.getType()), rotate, outputFile);
|
|
ImageUtil.rotate(fileUploadService.downloadInputStream(filePathVo.getPath(), filePathVo.getType()), rotate, outputFile);
|
|
if (outputFile.exists()) {
|
|
if (outputFile.exists()) {
|
|
fileUploadService.uploadRotateFile(outputFile, filePathVo.getUploadType(), filePathVo.getPath());
|
|
fileUploadService.uploadRotateFile(outputFile, filePathVo.getUploadType(), filePathVo.getPath());
|
|
@@ -447,7 +448,10 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
|
|
throw ExceptionResultEnum.ERROR.exception("旋转图片保存失败:" + e.getMessage());
|
|
throw ExceptionResultEnum.ERROR.exception("旋转图片保存失败:" + e.getMessage());
|
|
} finally {
|
|
} finally {
|
|
if (outputFile != null && outputFile.exists()) {
|
|
if (outputFile != null && outputFile.exists()) {
|
|
- outputFile.delete();
|
|
+ boolean deleted = outputFile.delete();
|
|
|
|
+ if (!deleted) {
|
|
|
|
+ log.error("[图片旋转]临时文件删除失败!" + outputFile.getAbsolutePath());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
lockService.unlock(LockType.ROTATE_PICTURE, paperLibraryId, isFront);
|
|
lockService.unlock(LockType.ROTATE_PICTURE, paperLibraryId, isFront);
|
|
}
|
|
}
|