|
@@ -162,21 +162,24 @@ public class WorkarkContractService {
|
|
|
|
|
|
public byte[] showPdf(long pdfId) {
|
|
|
|
|
|
- List<WorkarkContractPdfSeal> pdfSealList = getPdfSealList(pdfId);
|
|
|
-
|
|
|
byte[] workarkContractPdfData = getWorkarkContractPdfData(pdfId);
|
|
|
|
|
|
+ List<WorkarkContractPdfSeal> pdfSealList = getPdfSealList(pdfId);
|
|
|
+ if (pdfSealList.size() == 0) {
|
|
|
+ return workarkContractPdfData;
|
|
|
+ }
|
|
|
+
|
|
|
byte[] contractPdf = null;
|
|
|
|
|
|
for (WorkarkContractPdfSeal pdfSeal : pdfSealList) {
|
|
|
byte[] bytes = FileUtil.readFromUrl(pdfSeal.getPictureAddress());
|
|
|
- if(contractPdf != null){
|
|
|
+ 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());
|
|
|
+ contractPdf = PdfKeywordFinder.addPicturesPage(workarkContractPdfData,
|
|
|
+ bytes, pdfSeal.getPageSize(), pdfSeal.getPageLeft(), pdfSeal.getPageTop(), pdfSeal.getPictureWidth(), pdfSeal.getPictureHeight());
|
|
|
}
|
|
|
}
|
|
|
|