Commit 73a1da3b authored by 侯彦文's avatar 侯彦文

Merge remote-tracking branch 'origin/master'

parents d1ab04fa 43aff499
......@@ -122,6 +122,11 @@ public class Constants {
* 待审阅
*/
public static final String PENDING_REVIEW = "pendingReview";
/**
* 编制
*/
public static final String EDIT = "edit";
/**
* 修改中
*/
......
......@@ -244,7 +244,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
for (int i = 0; i < drawingLinks.size(); i++) {
ExtAtlasDrawingLinkVO item = drawingLinks.get(i);
DxDocumentVO doc = item.getTarget();
if (Constants.PENDING_REVIEW.equals(doc.getState()) || docState.equals(doc.getState())) {
if (Constants.EDIT.equals(doc.getState()) || Constants.PENDING_REVIEW.equals(doc.getState()) || docState.equals(doc.getState())) {
doc.setState(finalState);
//设置修改人和时间不变
doc.markModifyIdHold();
......@@ -271,7 +271,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//转pdf
String pdfName = "图册.pdf";
String filePdfPath = dir + File.separator + pdfName;
ExcelUtils.excelToPDF(filePath, filePdfPath);
// ExcelUtils.excelToPDF(filePath, filePdfPath);
ConvertExcelToPdf.excelToPDF(filePath, filePdfPath);
//上传文件到文件服务器
MultipartFile multipartFile = new MockMultipartFile("file", pdfName, com.yonde.dcs.plan.common.constants.Constants.CONTENT_TYPE_PDF, new FileInputStream(filePdfPath));
RepoFileVO fileVO = fileManagerFeignService.uploadFile(multipartFile, CommonUtil.getBucketIdByAppName(com.yonde.dcs.document.core.constants.Constants.APPLICATION_DOC_INNER_NAME));
......
package com.yonde.dcs.document.core.util;
import com.spire.xls.FileFormat;
import com.spire.xls.Workbook;
public class ConvertExcelToPdf {
/**
* excel转pdf
* @param excelPath xlsx
* @param pdfPath
*/
public static void excelToPDF(String excelPath, String pdfPath) {
//创建一个Workbook实例并加载Excel文件
Workbook workbook = new Workbook();
workbook.loadFromFile(excelPath);
//设置转换后的PDF页面高宽适应工作表的内容大小
workbook.getConverterSetting().setSheetFitToPage(true);
//将生成的文档保存到指定路径
workbook.saveToFile(pdfPath, FileFormat.PDF);
}
public static void main(String[] args) {
String dir = "C:\\Users\\Lenovo\\Desktop\\test\\";
excelToPDF(dir + "图册.xlsx", dir + "图.pdf");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment