Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
5dc6af87
Commit
5dc6af87
authored
Nov 18, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传pdf的cell包
parent
000322ae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
190 additions
and
205 deletions
+190
-205
aspose-cells-8.5.2.jar
cement-business/lib/aspose-cells-8.5.2.jar
+0
-0
pom.xml
cement-business/pom.xml
+0
-15
EntityEnclosureController.java
...cement/business/controller/EntityEnclosureController.java
+181
-180
FileExt.java
...in/java/cn/wise/sc/cement/business/enumation/FileExt.java
+9
-9
FastDFSUtils.java
...ava/cn/wise/sc/cement/business/util/dfs/FastDFSUtils.java
+0
-1
No files found.
cement-business/lib/aspose-cells-8.5.2.jar
0 → 100644
View file @
5dc6af87
File added
cement-business/pom.xml
View file @
5dc6af87
...
...
@@ -138,22 +138,7 @@
<version>
2.8.5
</version>
</dependency>
<dependency>
<groupId>
com.aspose
</groupId>
<!--自定义-->
<artifactId>
words
</artifactId>
<!--自定义-->
<version>
1.0
</version>
<!--自定义-->
<scope>
system
</scope>
<!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>
${basedir}/lib/words.jar
</systemPath>
<!--项目根目录下的lib文件夹下-->
</dependency>
<!-- https://mvnrepository.com/artifact/com.aspose/aspose-slides -->
<dependency>
<groupId>
com.aspose
</groupId>
<!--自定义-->
<artifactId>
sliders
</artifactId>
<!--自定义-->
<version>
1.0
</version>
<!--自定义-->
<scope>
system
</scope>
<!--system,类似provided,需要显式提供依赖的jar以后,Maven就不会在Repository中查找它-->
<systemPath>
${basedir}/lib/aspose.slides-15.9.0.jar
</systemPath>
<!--项目根目录下的lib文件夹下-->
</dependency>
<dependency>
<groupId>
com.aspose
</groupId>
<!--自定义-->
<artifactId>
cells
</artifactId>
<!--自定义-->
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntityEnclosureController.java
View file @
5dc6af87
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.enumation.FileExt
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
...
...
@@ -61,7 +62,7 @@ public class EntityEnclosureController {
}
else
{
return
BaseResponse
.
errorMsg
(
"登录信息失效"
);
}
if
(!
extName
.
equals
(
".pdf"
)
&&
(
extName
.
equals
(
".xls"
)
||
extName
.
equals
(
".xlsx"
)))
{
if
(
extName
.
contains
(
FileExt
.
EXCL
.
getName
())
||
extName
.
contains
(
FileExt
.
EXCLX
.
getName
(
)))
{
String
pdfPath
=
FastDFSUtils
.
conventAndUpload
(
file
.
getInputStream
(),
fileName
);
map
.
put
(
"pdfPath"
,
pdfPath
);
}
else
{
...
...
@@ -133,7 +134,7 @@ public class EntityEnclosureController {
mapSub
.
put
(
"fileUrl"
,
picUrl
);
mapSub
.
put
(
"fileName"
,
fileName
);
mapSub
.
put
(
"extName"
,
extName
);
if
(!
extName
.
equals
(
".pdf"
)
&&
(
extName
.
equals
(
".xls"
)
||
extName
.
equals
(
".xlsx"
)))
{
if
(
extName
.
contains
(
FileExt
.
EXCL
.
getName
())
||
extName
.
contains
(
FileExt
.
EXCLX
.
getName
(
)))
{
String
pdfPath
=
FastDFSUtils
.
conventAndUpload
(
file
.
getInputStream
(),
fileName
);
mapSub
.
put
(
"pdfPath"
,
pdfPath
);
}
else
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/enumation/FileExt.java
View file @
5dc6af87
package
cn
.
wise
.
sc
.
cement
.
business
.
enumation
;
import
com.alibaba.fastjson.annotation.JSONType
;
import
com.baomidou.mybatisplus.annotation.EnumValue
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @description: 文件扩展名
...
...
@@ -9,21 +12,18 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
* @create: 2020-10-16 13:40
**/
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
OBJECT
)
@JSONType
(
serializeEnumAsJavaBean
=
true
)
@Getter
@AllArgsConstructor
public
enum
FileExt
{
//office后缀名
DOC
(
".doc"
),
EXCL
(
".xls"
),
PDF
(
"pdf"
),
EXCLX
(
".xlsx"
);
@EnumValue
private
String
name
;
FileExt
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/dfs/FastDFSUtils.java
View file @
5dc6af87
...
...
@@ -4,7 +4,6 @@ import cn.hutool.core.io.FileUtil;
import
cn.hutool.core.io.file.FileReader
;
import
com.aspose.cells.SaveFormat
;
import
com.aspose.cells.Workbook
;
import
com.aspose.words.Document
;
import
org.apache.commons.io.FilenameUtils
;
import
org.csource.common.MyException
;
import
org.csource.common.NameValuePair
;
...
...
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