|
@@ -169,11 +169,19 @@ public class PrintCommonServiceImpl implements PrintCommonService {
|
|
|
File htmlFile = null;
|
|
|
if (Objects.nonNull(type) && Objects.equals(type, SystemConstant.FTL_PREFIX)) {
|
|
|
filePath = (String) jsonObject.get(SystemConstant.HTML_PATH);
|
|
|
- url = SystemConstant.TEMP_FILES_DIR + File.separator + filePath;
|
|
|
+ if (filePath.contains(SystemConstant.TEMP_FILES_DIR)) {
|
|
|
+ url = filePath;
|
|
|
+ } else {
|
|
|
+ url = SystemConstant.TEMP_FILES_DIR + File.separator + filePath;
|
|
|
+ }
|
|
|
htmlFile = new File(url);
|
|
|
} else if (Objects.nonNull(type) && Objects.equals(type, SystemConstant.HTML_PREFIX)) {
|
|
|
filePath = (String) jsonObject.get(SystemConstant.PATH);
|
|
|
- url = SystemConstant.TEMP_FILES_DIR + File.separator + filePath;
|
|
|
+ if (filePath.contains(SystemConstant.TEMP_FILES_DIR)) {
|
|
|
+ url = filePath;
|
|
|
+ } else {
|
|
|
+ url = SystemConstant.TEMP_FILES_DIR + File.separator + filePath;
|
|
|
+ }
|
|
|
UploadFileEnum uploadType = Enum.valueOf(UploadFileEnum.class, (String) jsonObject.get(SystemConstant.UPLOAD_TYPE));
|
|
|
// htmlFile = ossUtil.ossDownload(filePath, url);
|
|
|
if (oss) {
|
|
@@ -230,10 +238,11 @@ public class PrintCommonServiceImpl implements PrintCommonService {
|
|
|
object.put("pdfMd5", md5);
|
|
|
if (!oss) {
|
|
|
object.put(SystemConstant.PDF_PATH, pdfFile.getPath());
|
|
|
+ object.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
|
} else {
|
|
|
object.put(SystemConstant.PDF_PATH, pdfDirNameStr);
|
|
|
+ object.put(SystemConstant.TYPE, SystemConstant.OSS);
|
|
|
}
|
|
|
- object.put(SystemConstant.TYPE, SystemConstant.OSS);
|
|
|
object.put(SystemConstant.UPLOAD_TYPE, new UploadFileEnum[]{
|
|
|
UploadFileEnum.HTML,
|
|
|
UploadFileEnum.PDF
|