Forráskód Böngészése

生成pdf修改逻辑

wangliang 2 éve
szülő
commit
9d017b48bc

+ 5 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicAttachmentServiceImpl.java

@@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.FileCopyUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
@@ -86,6 +87,10 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
                 jsonPdf.put(SystemConstant.TYPE, SystemConstant.OSS);
                 fileStoreUtil.ossUpload(pdfDirName, pdfFile, pdfFileMd5, fileStoreUtil.getUploadEnumByPath(pdfDirName).getFssType());
             } else {
+                if (Objects.nonNull(dictionaryConfig.fssLocalPdfDomain()) && !StringUtils.isBlank(dictionaryConfig.fssLocalPdfDomain().getConfig())) {
+                    File file = new File(pdfStringJoiner.toString());
+                    FileCopyUtils.copy(file, pdfFile);
+                }
                 jsonPdf.put(SystemConstant.TYPE, SystemConstant.LOCAL);
             }
             jsonPdf.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.PDF);