不再生成通过函图片
This commit is contained in:
@@ -135,6 +135,8 @@ public class PDFUtils {
|
||||
* @param inputStream pdf 输入流
|
||||
* @param scale 缩放比例
|
||||
*/
|
||||
//不再将通过函转为图片
|
||||
@Deprecated
|
||||
public static ByteArrayOutputStream pdf2Img(InputStream inputStream, float scale) {
|
||||
org.icepdf.core.pobjects.Document document = new org.icepdf.core.pobjects.Document();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
@@ -407,12 +407,12 @@ public class FlowServiceImpl implements FlowService {
|
||||
//生成的 pdf 通过函内存输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(pdfOut.toByteArray());
|
||||
String passPdfUrl = ossServer.uploadFileServer(inputStream, "passLetter/" + passCode + ".pdf");
|
||||
//转换为图片
|
||||
inputStream.reset();
|
||||
ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//不再转换为图片
|
||||
//inputStream.reset();
|
||||
//ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
//inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//上传 OSS
|
||||
String passImageUrl = ossServer.uploadFileServer(inputStream, "passLetter/" + passCode + ".png");
|
||||
//String passImageUrl = ossServer.uploadFileServer(inputStream, "passLetter/" + passCode + ".png");
|
||||
//计算有效期截止日期
|
||||
Date expiryDate = DateUtil.offsetDay(passTime, 60);
|
||||
expiryDate = DateUtil.endOfDay(expiryDate);
|
||||
@@ -422,11 +422,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
interviewDO.setPassTime(passTime);
|
||||
interviewDO.setExpiryDate(DateUtil.formatDateTime(expiryDate));
|
||||
interviewDO.setPassPdfUrl(passPdfUrl);
|
||||
interviewDO.setPassImageUrl(passImageUrl);
|
||||
//interviewDO.setPassImageUrl(passImageUrl);
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
inputStream.close();
|
||||
pdfOut.close();
|
||||
imageOut.close();
|
||||
//imageOut.close();
|
||||
} catch (Exception e) {
|
||||
log.error("资格面试通过函生成失败 e{}", e.getMessage());
|
||||
throw new ServiceException("通过函生成失败!");
|
||||
|
||||
Reference in New Issue
Block a user