|
@@ -143,6 +143,9 @@ public class PrintCommonServiceServiceImpl implements PrintCommonService {
|
|
|
@Transactional
|
|
|
public BasicAttachment saveAttachmentPdf(ClassifyEnum classifyEnum, ExamDetail examDetail, BasicAttachment basicAttachment, List<PdfDto> pdfList, Integer printCount, Integer sequence) throws IOException, DocumentException {
|
|
|
try {
|
|
|
+ BasicSchool basicSchool = (BasicSchool) ServletUtil.getRequestSchool();
|
|
|
+ Map<String, String> flowSchoolCodeMap = SystemConstant.getFlowSchoolCodeMap();
|
|
|
+
|
|
|
boolean oss = dictionaryConfig.sysDomain().isOss();
|
|
|
JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
|
|
|
String type = basicAttachment.getType();
|
|
@@ -180,7 +183,12 @@ public class PrintCommonServiceServiceImpl implements PrintCommonService {
|
|
|
pdfFile.getParentFile().mkdirs();
|
|
|
pdfFile.createNewFile();
|
|
|
}
|
|
|
- HtmlToPdfUtil.convert(htmlFile.getPath(), destUrl, PageSizeEnum.A4);
|
|
|
+ if (Objects.equals(basicSchool.getCode(), flowSchoolCodeMap.get(SystemConstant.GDYKDX_FLOW_KEY))) {
|
|
|
+ HtmlToPdfUtil.convert(htmlFile.getPath(), destUrl, PageSizeEnum.A3);
|
|
|
+ } else if(Objects.equals(basicSchool.getCode(), flowSchoolCodeMap.get(SystemConstant.JXZYY_FLOW_KEY))){
|
|
|
+ HtmlToPdfUtil.convert(htmlFile.getPath(), destUrl, PageSizeEnum.A4);
|
|
|
+ }
|
|
|
+
|
|
|
// File pdfFile = asposePdfUtil.documentToPdf(htmlFile.getPath(), destUrl, PaperSize.A4);
|
|
|
String htmlFileMd5 = DigestUtils.md5Hex(new FileInputStream(htmlFile));
|
|
|
byte[] data = ByteArray.fromFile(pdfFile).value();
|
|
@@ -215,7 +223,11 @@ public class PrintCommonServiceServiceImpl implements PrintCommonService {
|
|
|
examDetail.setAttachmentPath(attachmentPath.toJSONString());
|
|
|
basicAttachment.setPages(pdfDto.getActualPageCount());
|
|
|
for (int i = 0; i < printCount; i++) {
|
|
|
- pdfList.add(new PdfDto(pdfFile.getPath(), PageSizeEnum.A4, pdfDto.getPageCount(), sequence));
|
|
|
+ if (Objects.equals(basicSchool.getCode(), flowSchoolCodeMap.get(SystemConstant.GDYKDX_FLOW_KEY))) {
|
|
|
+ pdfList.add(new PdfDto(pdfFile.getPath(), PageSizeEnum.A3, pdfDto.getPageCount(), sequence));
|
|
|
+ } else if(Objects.equals(basicSchool.getCode(), flowSchoolCodeMap.get(SystemConstant.JXZYY_FLOW_KEY))){
|
|
|
+ pdfList.add(new PdfDto(pdfFile.getPath(), PageSizeEnum.A4, pdfDto.getPageCount(), sequence));
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("请求出错", e);
|