|
@@ -124,20 +124,22 @@ public class CreatePdfUtil {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("printType", ClassifyEnum.CHECK_IN.name());
|
|
|
File localFile;
|
|
|
- if (SystemConstant.LOCAL.equals(jsonObject.get(SystemConstant.TYPE))) {
|
|
|
- localFile = new File(filePath);
|
|
|
- object.put(SystemConstant.PDF_PATH, localFile.getPath());
|
|
|
- object.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
|
- } else {
|
|
|
- localFile = fileStoreUtil.ossDownload(filePath, filePath, uploadFileEnum.getFssType());
|
|
|
- object.put(SystemConstant.PDF_PATH, localFile.getPath());
|
|
|
- object.put(SystemConstant.TYPE, SystemConstant.OSS);
|
|
|
- }
|
|
|
- object.put(SystemConstant.UPLOAD_TYPE, UploadFileEnum.PDF);
|
|
|
- PdfDto pdfDto = PdfUtil.addPdfPage(localFile);
|
|
|
+// if (SystemConstant.LOCAL.equals(jsonObject.get(SystemConstant.TYPE))) {
|
|
|
+// localFile = new File(filePath);
|
|
|
+// object.put(SystemConstant.PDF_PATH, localFile.getPath());
|
|
|
+// object.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
|
+// } else {
|
|
|
+// localFile = fileStoreUtil.ossDownload(filePath, filePath, uploadFileEnum.getFssType());
|
|
|
+// object.put(SystemConstant.PDF_PATH, localFile.getPath());
|
|
|
+// object.put(SystemConstant.TYPE, SystemConstant.OSS);
|
|
|
+// }
|
|
|
+ object.put(SystemConstant.PDF_PATH, filePath);
|
|
|
+ object.put(SystemConstant.TYPE, SystemConstant.LOCAL);
|
|
|
+ object.put(SystemConstant.UPLOAD_TYPE, uploadFileEnum);
|
|
|
+// PdfDto pdfDto = PdfUtil.addPdfPage(localFile);
|
|
|
|
|
|
- byte[] data = ByteArray.fromFile(localFile).value();
|
|
|
- String md5 = ByteArray.md5(data).toHexString();
|
|
|
+// byte[] data = ByteArray.fromFile(localFile).value();
|
|
|
+ String md5 = basicAttachment.getMd5();
|
|
|
object.put("pdfMd5", md5);
|
|
|
|
|
|
jsonArray.add(object);
|
|
@@ -145,7 +147,7 @@ public class CreatePdfUtil {
|
|
|
examDetail.setAttachmentPath(attachmentPath.toJSONString());
|
|
|
|
|
|
for (int i = 0; i < printCount; i++) {
|
|
|
- ordinaryPdfList.add(new PdfDto(localFile.getPath(), PageSizeEnum.A4, pdfDto.getPageCount()));
|
|
|
+ ordinaryPdfList.add(new PdfDto(filePath, PageSizeEnum.A4, 0));
|
|
|
}
|
|
|
} else {
|
|
|
printCommonService.saveAttachmentPdf(ClassifyEnum.CHECK_IN, examDetail, basicAttachment, ordinaryPdfList, printCount, 0, fileTempList);
|
|
@@ -1465,7 +1467,7 @@ public class CreatePdfUtil {
|
|
|
//通用题卡生成卷袋贴条码
|
|
|
String packageCode = examDetail.getPackageCode() + sequence;
|
|
|
String packageCodeImg = GoogleBarCodeUtil.createBarCode(packageCode, false);
|
|
|
- cardTemp = cardTemp.replaceAll("\\$\\{packageCodeDom\\}", "<img src='"+"data:image/png;base64," + packageCodeImg+"'><p>"+packageCode+"</p>");
|
|
|
+ cardTemp = cardTemp.replaceAll("\\$\\{packageCodeDom\\}", "<img src='" + "data:image/png;base64," + packageCodeImg + "'><p>" + packageCode + "</p>");
|
|
|
// cardTemp = cardTemp.replaceAll("\\$\\{packageCode\\}", packageCode);
|
|
|
// 上传通卡
|
|
|
// if (cardTemp.contains("<div class=\"page-box page-box-0\">")) {
|