|
@@ -1,5 +1,6 @@
|
|
|
package com.bosshand.virgo.file.service;
|
|
|
|
|
|
+import com.bosshand.virgo.core.utils.FileUtil;
|
|
|
import com.bosshand.virgo.exception.ServiceException;
|
|
|
import com.bosshand.virgo.file.dao.WorkarkContractDao;
|
|
|
import com.bosshand.virgo.file.dao.WorkarkContractPdfDao;
|
|
@@ -9,6 +10,7 @@ import com.bosshand.virgo.file.model.WorkarkContractPdf;
|
|
|
import com.bosshand.virgo.file.model.WorkarkContractPdfSeal;
|
|
|
import com.bosshand.virgo.file.util.AliyunOSSUtil;
|
|
|
import com.bosshand.virgo.file.util.Doc2Pdf;
|
|
|
+import com.bosshand.virgo.file.util.PdfKeywordFinder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -158,4 +160,29 @@ public class WorkarkContractService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public byte[] showPdf(long pdfId) {
|
|
|
+
|
|
|
+ List<WorkarkContractPdfSeal> pdfSealList = getPdfSealList(pdfId);
|
|
|
+
|
|
|
+ byte[] workarkContractPdfData = getWorkarkContractPdfData(pdfId);
|
|
|
+
|
|
|
+ byte[] contractPdf = null;
|
|
|
+
|
|
|
+ for (WorkarkContractPdfSeal pdfSeal : pdfSealList) {
|
|
|
+ byte[] bytes = FileUtil.readFromUrl(pdfSeal.getPictureAddress());
|
|
|
+ if(contractPdf != null){
|
|
|
+ contractPdf = PdfKeywordFinder.addPicturesPage(contractPdf,
|
|
|
+ bytes, pdfSeal.getPageSize(), pdfSeal.getPageLeft(), pdfSeal.getPageTop(), pdfSeal.getPictureWidth(), pdfSeal.getPictureHeight());
|
|
|
+
|
|
|
+ } else {
|
|
|
+ contractPdf = PdfKeywordFinder.addPicturesPage(workarkContractPdfData,
|
|
|
+ bytes, pdfSeal.getPageSize(), pdfSeal.getPageLeft(), pdfSeal.getPageTop(), pdfSeal.getPictureWidth(), pdfSeal.getPictureHeight());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return contractPdf;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|