Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-doc-expand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-doc-expand
Commits
73a1da3b
Commit
73a1da3b
authored
Oct 14, 2024
by
侯彦文
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
d1ab04fa
43aff499
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
2 deletions
+39
-2
Constants.java
...java/com/yonde/dcs/document/core/constants/Constants.java
+5
-0
ExtAutoTaskServiceImpl.java
...cs/document/core/service/impl/ExtAutoTaskServiceImpl.java
+3
-2
ConvertExcelToPdf.java
...a/com/yonde/dcs/document/core/util/ConvertExcelToPdf.java
+31
-0
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/constants/Constants.java
View file @
73a1da3b
...
...
@@ -122,6 +122,11 @@ public class Constants {
* 待审阅
*/
public
static
final
String
PENDING_REVIEW
=
"pendingReview"
;
/**
* 编制
*/
public
static
final
String
EDIT
=
"edit"
;
/**
* 修改中
*/
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
73a1da3b
...
...
@@ -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
));
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/util/ConvertExcelToPdf.java
0 → 100644
View file @
73a1da3b
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment