Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
a6d837ed
Commit
a6d837ed
authored
Mar 25, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件上传转换添加日志
parent
eb0308d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+7
-4
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
a6d837ed
...
...
@@ -790,10 +790,10 @@ public class BChapterServiceImpl implements BChapterService {
LogUtil
.
fileChangeLog
(
"------------------存在直接返回路径----------------------------"
+
fileOld
);
return
returnBasePath
+
File
.
separator
+
name
;
}
else
{
LogUtil
.
fileChangeLog
(
"------------------判断是否可读----------------------------"
+
fileOld
);
String
downLoadName
=
downLoadFile
(
bFile
,
file
,
filePath
);
LogUtil
.
fileChangeLog
(
"------------------判断pdf是否可读----------------------------"
+
fileOld
);
FileReadableUtil
.
fileReadable
(
filePath
+
File
.
separator
+
downLoadName
,
fileMaxSize
,
fileMaxPages
);
LogUtil
.
fileChangeLog
(
"------------------返回下载后路径-----------------------------"
+
downLoadName
);
LogUtil
.
fileChangeLog
(
"------------------
pdf文件可读--
返回下载后路径-----------------------------"
+
downLoadName
);
return
returnBasePath
+
File
.
separator
+
downLoadName
;
}
}
...
...
@@ -801,7 +801,7 @@ public class BChapterServiceImpl implements BChapterService {
if
(
FileTypeEnum
.
PPT
.
getCode
().
equals
(
bFile
.
getType
())
||
FileTypeEnum
.
WORD
.
getCode
().
equals
(
bFile
.
getType
())
||
FileTypeEnum
.
TXT
.
getCode
().
equals
(
bFile
.
getType
()))
{
LogUtil
.
fileChangeLog
(
"------------------文件为ppt或word或txt----------------------------"
);
if
(
fileNew
.
exists
())
{
LogUtil
.
fileChangeLog
(
"------------------转换后文件
存在
直接返回-----------------------------"
);
LogUtil
.
fileChangeLog
(
"------------------转换后文件
-存在-
直接返回-----------------------------"
);
return
returnBasePath
+
File
.
separator
+
newName
;
}
else
{
LogUtil
.
fileChangeLog
(
"------------------删除老文件----------------------------"
);
...
...
@@ -812,6 +812,7 @@ public class BChapterServiceImpl implements BChapterService {
//判断文件是否可读
LogUtil
.
fileChangeLog
(
"------------------判断文件是否可读-----------------------------"
+
filePath
+
File
.
separator
+
name
);
FileReadableUtil
.
fileReadable
(
filePath
+
File
.
separator
+
downLoadFileName
,
fileMaxSize
,
fileMaxPages
);
LogUtil
.
fileChangeLog
(
"------------------------非pdf文件可读-----------------------"
+
downLoadFileName
);
LogUtil
.
fileChangeLog
(
"-----------------------------------------------downLoadFileUrl:"
+
filePath
+
File
.
separator
+
downLoadFileName
);
LogUtil
.
fileChangeLog
(
"-----------------------------------------------filePath:"
+
filePath
+
File
.
separator
+
newName
);
int
result
=
officeToPdf
.
transformToPdf
(
filePath
+
File
.
separator
+
downLoadFileName
,
filePath
+
File
.
separator
+
newName
);
...
...
@@ -892,13 +893,15 @@ public class BChapterServiceImpl implements BChapterService {
byte
[]
buf
=
new
byte
[
1024
*
512
];
int
length
=
bis
.
read
(
buf
);
//保存文件
LogUtil
.
fileChangeLog
(
"------------------保存文件-----------------------------"
);
LogUtil
.
fileChangeLog
(
"------------------保存文件
开始
-----------------------------"
);
while
(
length
!=
-
1
)
{
bos
.
write
(
buf
,
0
,
length
);
length
=
bis
.
read
(
buf
);
}
LogUtil
.
fileChangeLog
(
"------------------关闭--BufferedInputStream--和--BufferedOutputStream--流---------------------------"
);
bos
.
close
();
bis
.
close
();
LogUtil
.
fileChangeLog
(
"------------------断开--HttpURLConnection--连接---------------------------"
);
conn
.
disconnect
();
LogUtil
.
fileChangeLog
(
"****************download + end***********"
+
DateFormatUtils
.
format
(
new
Date
(),
"HH:mm:ss"
));
}
catch
(
Exception
e
)
{
...
...
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