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
745610a2
Commit
745610a2
authored
Oct 21, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口、添加新接口
parent
ef475f9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+8
-6
Global.java
src/main/java/org/rcisoft/common/component/Global.java
+4
-0
application-mt.yml
src/main/resources/application-mt.yml
+1
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
745610a2
...
...
@@ -257,7 +257,8 @@ public class BChapterServiceImpl implements BChapterService {
public
String
changeFileToPdf
(
String
chapterId
)
{
//1. 获取文件信息
BFile
bFile
=
bFileRepository
.
selectInfoByChapterId
(
chapterId
);
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()+
"/"
+
global
.
getTEMP_LOCATION
()+
"/"
+
bFile
.
getLessonId
();
String
filePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()+
"/"
+
global
.
getCOURSE_LOCATION
()+
"/"
+
bFile
.
getLessonId
();
String
returnBasePath
=
global
.
getRETURN_UPLOAD_SERVER_LOCATION
()+
"/"
+
global
.
getCOURSE_LOCATION
()+
bFile
.
getLessonId
();
File
file
=
new
File
(
filePath
);
//2. pdf 本地是否存在, word ppt 转换后的pdf是否存在
File
fileOld
=
new
File
(
filePath
+
"/"
+
bFile
.
getFileName
());
...
...
@@ -266,15 +267,16 @@ public class BChapterServiceImpl implements BChapterService {
File
fileNew
=
new
File
(
filePath
+
"/"
+
newName
);
if
(
"3"
.
equals
(
bFile
.
getType
())){
if
(
fileOld
.
exists
()){
return
fil
ePath
+
"/"
+
bFile
.
getFileName
();
return
returnBas
ePath
+
"/"
+
bFile
.
getFileName
();
}
else
{
return
downLoadFile
(
bFile
,
file
,
filePath
);
String
downLoadName
=
downLoadFile
(
bFile
,
file
,
filePath
);
return
returnBasePath
+
"/"
+
downLoadName
;
}
}
//3. pdf不存在,下载 , 删除word ppt,重新下载,转换
if
(
"2"
.
equals
(
bFile
.
getType
())
||
"4"
.
equals
(
bFile
.
getType
())){
if
(
fileNew
.
exists
()){
return
fil
ePath
+
"/"
+
newName
;
return
returnBas
ePath
+
"/"
+
newName
;
}
else
{
fileOld
.
delete
();
String
downLoadFileUrl
=
downLoadFile
(
bFile
,
file
,
filePath
);
...
...
@@ -286,7 +288,7 @@ public class BChapterServiceImpl implements BChapterService {
//4. 更新在 bfile 表 , ppt和word 存一下转换之后的url filePath
bFile
.
setFileUrl
(
filePath
+
"/"
+
newName
);
bFileRepository
.
updateByPrimaryKeySelective
(
bFile
);
return
fil
ePath
+
"/"
+
newName
;
return
returnBas
ePath
+
"/"
+
newName
;
}
}
else
{
return
null
;
...
...
@@ -342,7 +344,7 @@ public class BChapterServiceImpl implements BChapterService {
log
.
error
(
e
.
getMessage
()
+
"下载文件异常"
);
throw
new
ServiceException
(
ResultServiceEnums
.
DOWNLOAD_ERROR
);
}
return
filePath
+
bFile
.
getFileName
();
return
bFile
.
getFileName
();
}
@Override
...
...
src/main/java/org/rcisoft/common/component/Global.java
View file @
745610a2
...
...
@@ -32,6 +32,10 @@ public class Global {
@Value
(
"${global.path.base_upload_server_location}"
)
private
String
BASE_UPLOAD_SERVER_LOCATION
;
/*服务器返回文件路径*/
@Value
(
"${global.path.return_upload_server_location}"
)
private
String
RETURN_UPLOAD_SERVER_LOCATION
;
/*课程相关文件路径*/
@Value
(
"${global.path.course_location}"
)
...
...
src/main/resources/application-mt.yml
View file @
745610a2
...
...
@@ -72,6 +72,7 @@ global:
pubPath
:
/lk/publicCerts.store
path
:
base_upload_server_location
:
/working/resource/eduServer/
return_upload_server_location
:
http://192.168.5.201:18080/eduServer/
course_location
:
course
lesson_location
:
lesson
sl_location
:
sl
...
...
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