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
4b98f49b
Commit
4b98f49b
authored
Jan 02, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善接口
parent
1836d5d1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
447 additions
and
201 deletions
+447
-201
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+3
-3
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+5
-4
BChapter.java
...n/java/org/rcisoft/business/bchapter/entity/BChapter.java
+14
-1
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+71
-51
BFileController.java
...rg/rcisoft/business/bfile/controller/BFileController.java
+18
-36
BFileRepository.java
.../java/org/rcisoft/business/bfile/dao/BFileRepository.java
+42
-0
BFile.java
src/main/java/org/rcisoft/business/bfile/entity/BFile.java
+6
-6
BFileService.java
...java/org/rcisoft/business/bfile/service/BFileService.java
+9
-9
BFileServiceImpl.java
...rcisoft/business/bfile/service/impl/BFileServiceImpl.java
+257
-0
BSlServiceImpl.java
...org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
+4
-25
BVideoRepository.java
...ava/org/rcisoft/business/bvideo/dao/BVideoRepository.java
+0
-61
Global.java
src/main/java/org/rcisoft/common/component/Global.java
+8
-0
application-dev.yml
src/main/resources/application-dev.yml
+5
-3
BFileMapper.xml
...in/resources/mapper/business/bfile/mapper/BFileMapper.xml
+5
-2
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
4b98f49b
...
@@ -66,12 +66,12 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -66,12 +66,12 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课id"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"slId"
,
value
=
"开课id"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterName"
,
value
=
"章节名称"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"chapterName"
,
value
=
"章节名称"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"上一级"
,
required
=
fals
e
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"上一级"
,
required
=
tru
e
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"classHour"
,
value
=
"课时"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"classHour"
,
value
=
"课时"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"isTest"
,
value
=
"1:实验 2:视频 3:PPT'"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"isTest"
,
value
=
"1:实验 2:视频 3:PPT'"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonOrSl"
,
value
=
"课程或开课;0:开课 1:课程"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonOrSl"
,
value
=
"课程或开课;0:开课 1:课程"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonId"
,
value
=
"课程ID(课程ID和开课ID只能存在一个)"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"lessonId"
,
value
=
"课程ID(课程ID和开课ID只能存在一个)"
,
required
=
false
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasAnyRole('ROLE_100
2
','ROLE_1002')"
)
@PreAuthorize
(
"hasAnyRole('ROLE_100
1
','ROLE_1002')"
)
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BChapter
bChapter
,
public
Result
add
(
@Valid
BChapter
bChapter
,
BindingResult
bindingResult
BindingResult
bindingResult
...
@@ -91,7 +91,7 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -91,7 +91,7 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiOperation
(
value
=
"删除章节"
,
notes
=
"根据ID删除一条记录"
)
@ApiOperation
(
value
=
"删除章节"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@PreAuthorize
(
"has
Role(
'ROLE_1002')"
)
@PreAuthorize
(
"has
AnyRole('ROLE_1001',
'ROLE_1002')"
)
@PostMapping
(
value
=
"/remove"
)
@PostMapping
(
value
=
"/remove"
)
public
Result
remove
(
String
id
)
{
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bChapterService
.
removeBChapter
(
id
,
getToken
());
PersistModel
data
=
bChapterService
.
removeBChapter
(
id
,
getToken
());
...
...
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
4b98f49b
...
@@ -46,13 +46,14 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -46,13 +46,14 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
*/
*/
@Select
(
"<script>SELECT\n"
+
@Select
(
"<script>SELECT\n"
+
" bc.*,\n"
+
" bc.*,\n"
+
" (SELECT bv.video_url FROM b_video bv WHERE bv.business_id = bcv1.video_id) AS videoUrl,\n"
+
" bf.video_url AS videoUrl,\n"
+
" (SELECT bv.video_url FROM b_video bv WHERE bv.business_id = bcv2.video_id) AS fileUrl,\n"
+
" bf.file_url AS fileUrl,\n"
+
" bf.ppt_url AS pptUrl,\n"
+
" bf.pdf_url AS pdfUrl,\n"
+
" (SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum \n"
+
" (SELECT count(*) FROM b_r_student_chapter brs WHERE brs.chapter_id = bc.business_id AND brs.score = - 1) AS studentNum \n"
+
" FROM\n"
+
" FROM\n"
+
" b_chapter bc\n"
+
" b_chapter bc\n"
+
" LEFT JOIN b_r_chapter_video bcv1 ON bcv1.chapter_id = bc.business_id and bcv1.type = '0'\n"
+
" LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id "
+
" LEFT JOIN b_r_chapter_video bcv2 ON bcv2.chapter_id = bc.business_id and bcv2.type = '1'\n"
+
" \n"
+
" \n"
+
" WHERE\n"
+
" WHERE\n"
+
" bc.del_flag = 0\n"
+
" bc.del_flag = 0\n"
+
...
...
src/main/java/org/rcisoft/business/bchapter/entity/BChapter.java
View file @
4b98f49b
...
@@ -71,10 +71,23 @@ public class BChapter extends IdEntity<BChapter> {
...
@@ -71,10 +71,23 @@ public class BChapter extends IdEntity<BChapter> {
@Transient
@Transient
private
String
videoUrl
;
private
String
videoUrl
;
@Transient
@Transient
private
String
fileUrl
;
private
String
fileUrl
;
@Transient
private
String
pptUrl
;
@Transient
private
String
pdfUrl
;
/**
* 课程的父ID(当作map的key存放开课的父ID用)
*/
@Transient
private
String
lPid
;
@Transient
private
String
sPid
;
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
bchapter
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
bchapter
.
service
.
impl
;
import
com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList
;
import
org.apache.commons.io.FileUtils
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dto.QueryScoreListDTO
;
import
org.rcisoft.business.bchapter.dto.QueryScoreListDTO
;
import
org.rcisoft.business.bchapter.dto.ScoreInfoDTO
;
import
org.rcisoft.business.bchapter.dto.ScoreInfoDTO
;
...
@@ -17,9 +17,8 @@ import org.rcisoft.business.brslstudent.dao.BRSlStudentRepository;
...
@@ -17,9 +17,8 @@ import org.rcisoft.business.brslstudent.dao.BRSlStudentRepository;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.business.bsl.enums.AuditStatusEnum
;
import
org.rcisoft.business.bsl.enums.AuditStatusEnum
;
import
org.rcisoft.business.bstudent.dao.BStudentRepository
;
import
org.rcisoft.business.bstudent.dao.BStudentRepository
;
import
org.rcisoft.business.bvideo.dao.BVideoRepository
;
import
org.rcisoft.business.bfile.dao.BFileRepository
;
import
org.rcisoft.business.bvideo.entity.BVideo
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.business.bvideo.entity.UrlDto
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.exception.ServiceException
;
...
@@ -55,7 +54,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -55,7 +54,7 @@ public class BChapterServiceImpl implements BChapterService {
@Autowired
@Autowired
private
BLessonRepository
bLessonRepository
;
private
BLessonRepository
bLessonRepository
;
@Autowired
@Autowired
private
B
VideoRepository
bVideo
Repository
;
private
B
FileRepository
bFile
Repository
;
@Autowired
@Autowired
private
Global
global
;
private
Global
global
;
...
@@ -204,7 +203,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -204,7 +203,7 @@ public class BChapterServiceImpl implements BChapterService {
//获取课程的章节列表
//获取课程的章节列表
List
<
BChapter
>
lessonList
=
bChapterRepository
.
queryChapterByLessonId
(
bLessonId
);
List
<
BChapter
>
lessonList
=
bChapterRepository
.
queryChapterByLessonId
(
bLessonId
);
List
<
BChapter
>
chapterList
=
new
ArrayList
<>();
List
<
BChapter
>
chapterList
=
new
ArrayList
<>();
//map存放章的ID(key:
章名称
value:新的章ID)
//map存放章的ID(key:
老的章id
value:新的章ID)
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
for
(
int
i
=
0
;
i
<
lessonList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
lessonList
.
size
();
i
++){
BChapter
sl_chapter
=
new
BChapter
();
BChapter
sl_chapter
=
new
BChapter
();
...
@@ -221,20 +220,27 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -221,20 +220,27 @@ public class BChapterServiceImpl implements BChapterService {
UserUtil
.
setCurrentPersistOperation
(
sl_chapter
);
UserUtil
.
setCurrentPersistOperation
(
sl_chapter
);
if
(
lessonList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
if
(
lessonList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
sl_chapter
.
setPid
(
lessonList
.
get
(
i
).
getPid
());
sl_chapter
.
setPid
(
lessonList
.
get
(
i
).
getPid
());
map
.
put
(
sl_chapter
.
getChapterName
(),
sl_chapter
.
getBusinessId
());
map
.
put
(
lessonList
.
get
(
i
).
getBusinessId
(),
sl_chapter
.
getBusinessId
());
}
else
{
}
else
{
sl_chapter
.
set
Pid
(
"0"
);
sl_chapter
.
set
LPid
(
lessonList
.
get
(
i
).
getPid
()
);
}
}
//set老的章节ID后面比对用
lessonList
.
get
(
i
).
setSPid
(
lessonList
.
get
(
i
).
getBusinessId
());
sl_chapter
.
setSPid
(
lessonList
.
get
(
i
).
getBusinessId
());
chapterList
.
add
(
sl_chapter
);
chapterList
.
add
(
sl_chapter
);
}
}
for
(
int
i
=
0
;
i
<
chapterList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
chapterList
.
size
();
i
++){
if
(!
chapterList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
if
(!
chapterList
.
get
(
i
).
getPid
().
equals
(
"-1"
)){
//根据父ID获取父节点章节名称
String
chapterName
=
bChapterRepository
.
selectChapterNameByPid
(
lessonList
.
get
(
i
).
getPid
());
//取出map中存放的新的章ID作为父节点ID
//取出map中存放的新的章ID作为父节点ID
chapterList
.
get
(
i
).
setPid
(
String
.
valueOf
(
map
.
get
(
chapter
Name
)));
chapterList
.
get
(
i
).
setPid
(
String
.
valueOf
(
map
.
get
(
chapter
List
.
get
(
i
).
getLPid
()
)));
}
}
}
}
if
(
chapterList
.
size
()>
0
){
result
=
bChapterRepository
.
insertChapterList
(
chapterList
);
}
String
oldPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()+
File
.
separator
String
oldPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()+
File
.
separator
+
global
.
getCOURSE_LOCATION
()+
File
.
separator
+
global
.
getCOURSE_LOCATION
()+
File
.
separator
+
global
.
getLESSON_LOCATION
()+
File
.
separator
+
global
.
getLESSON_LOCATION
()+
File
.
separator
...
@@ -243,9 +249,58 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -243,9 +249,58 @@ public class BChapterServiceImpl implements BChapterService {
+
global
.
getCOURSE_LOCATION
()+
File
.
separator
+
global
.
getCOURSE_LOCATION
()+
File
.
separator
+
global
.
getSL_LOCATION
()+
File
.
separator
+
global
.
getSL_LOCATION
()+
File
.
separator
+
slId
;
+
slId
;
//copyFileToSl(oldPath,newPath,bLessonId,slId);
if
(
chapterList
.
size
()>
0
){
//复制章节的所有文件
result
=
bChapterRepository
.
insertChapterList
(
chapterList
);
try
{
//copyFileToSl(oldPath,newPath,bLessonId,slId);
File
oldFile
=
new
File
(
oldPath
);
File
newFile
=
new
File
(
newPath
);
FileUtils
.
copyDirectory
(
oldFile
,
newFile
,
true
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
//数据库操作
for
(
BChapter
leBChapter
:
lessonList
){
for
(
BChapter
slChapter
:
chapterList
){
if
(
leBChapter
.
getSPid
().
equals
(
slChapter
.
getSPid
())&&!
leBChapter
.
getPid
().
equals
(
"-1"
)){
BFile
bFile
=
bFileRepository
.
queryBVideoByChapterId
(
leBChapter
.
getBusinessId
());
BFile
newVideo
=
new
BFile
();
newVideo
.
setChapterId
(
slChapter
.
getBusinessId
());
newVideo
.
setVideoName
(
bFile
.
getVideoName
());
UserUtil
.
setCurrentPersistOperation
(
newVideo
);
//将节的ID替换成新的
if
(
bFile
!=
null
){
if
(
bFile
.
getVideoUrl
()!=
null
&&!
bFile
.
getVideoUrl
().
equals
(
""
)){
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setVideoUrl
(
path
);
}
if
(
bFile
.
getFileUrl
()!=
null
&&!
bFile
.
getFileUrl
().
equals
(
""
)){
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setFileUrl
(
path
);
}
if
(
bFile
.
getPptUrl
()!=
null
&&!
bFile
.
getPptUrl
().
equals
(
""
)){
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setPptUrl
(
path
);
}
if
(
bFile
.
getPdfUrl
()!=
null
&&!
bFile
.
getPdfUrl
().
equals
(
""
)){
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setPdfUrl
(
path
);
}
//重命名复制之后的文件
String
filePath
=
newPath
+
File
.
separator
+
leBChapter
.
getBusinessId
();
String
newFilePath
=
newPath
+
File
.
separator
+
slChapter
.
getBusinessId
();
File
file
=
new
File
(
filePath
);
file
.
renameTo
(
new
File
(
newFilePath
));
//插入对象
bFileRepository
.
insertSelective
(
newVideo
);
}
}
}
}
}
return
result
;
return
result
;
}
}
...
@@ -255,9 +310,8 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -255,9 +310,8 @@ public class BChapterServiceImpl implements BChapterService {
* @param oldPath
* @param oldPath
* @param newPath
* @param newPath
*/
*/
private
void
copyFileToSl
(
String
oldPath
,
String
newPath
,
String
bLessonId
,
String
slId
)
{
private
void
copyFileToSl
(
String
oldPath
,
String
newPath
,
String
bLessonId
,
String
slId
)
throws
IOException
{
UrlDto
urlDto
=
new
UrlDto
();
File
oldFile
=
new
File
(
oldPath
);
File
oldFile
=
new
File
(
oldPath
);
File
[]
fs
=
oldFile
.
listFiles
();
File
[]
fs
=
oldFile
.
listFiles
();
File
newFile
=
new
File
(
newPath
);
File
newFile
=
new
File
(
newPath
);
...
@@ -271,40 +325,6 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -271,40 +325,6 @@ public class BChapterServiceImpl implements BChapterService {
copyFileToSl
(
f
.
getPath
(),
newPath
+
File
.
separator
+
f
.
getName
(),
bLessonId
,
slId
);
copyFileToSl
(
f
.
getPath
(),
newPath
+
File
.
separator
+
f
.
getName
(),
bLessonId
,
slId
);
}
}
}
}
List
<
BChapter
>
leChapters
=
bChapterRepository
.
queryChapterByLessonId
(
bLessonId
);
List
<
BChapter
>
slChapters
=
bChapterRepository
.
queryChapterBySlId
(
slId
);
for
(
BChapter
leBChapter
:
leChapters
){
for
(
BChapter
slChapter
:
slChapters
){
if
(
leBChapter
.
getChapterName
().
equals
(
slChapter
.
getChapterName
())){
BVideo
bVideo
=
bVideoRepository
.
queryBVideoByChapterId
(
leBChapter
.
getBusinessId
());
BVideo
newVideo
=
new
BVideo
();
newVideo
.
setBusinessId
(
bVideo
.
getBusinessId
());
if
(
bVideo
!=
null
){
if
(
bVideo
.
getVideoUrl
()!=
null
&&!
bVideo
.
getVideoUrl
().
equals
(
""
)){
String
newUrl
=
bVideo
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setVideoUrl
(
path
);
}
if
(
bVideo
.
getFileUrl
()!=
null
&&!
bVideo
.
getFileUrl
().
equals
(
""
)){
String
newUrl
=
bVideo
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setFileUrl
(
path
);
}
if
(
bVideo
.
getPptUrl
()!=
null
&&!
bVideo
.
getPptUrl
().
equals
(
""
)){
String
newUrl
=
bVideo
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setPptUrl
(
path
);
}
if
(
bVideo
.
getPdfUrl
()!=
null
&&!
bVideo
.
getPdfUrl
().
equals
(
""
)){
String
newUrl
=
bVideo
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
newVideo
.
setPdfUrl
(
path
);
}
bVideoRepository
.
updateByPrimaryKeySelective
(
newVideo
);
}
}
}
}
}
}
private
void
fileCopy
(
String
oldPath
,
String
newPath
)
{
private
void
fileCopy
(
String
oldPath
,
String
newPath
)
{
...
@@ -330,7 +350,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -330,7 +350,7 @@ public class BChapterServiceImpl implements BChapterService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
@Override
...
...
src/main/java/org/rcisoft/business/b
video/controller/BVideo
Controller.java
→
src/main/java/org/rcisoft/business/b
file/controller/BFile
Controller.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
b
video
.
controller
;
package
org
.
rcisoft
.
business
.
b
file
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.rcisoft.business.b
video.entity.BVideo
;
import
org.rcisoft.business.b
file.entity.BFile
;
import
org.rcisoft.business.b
video.service.BVideo
Service
;
import
org.rcisoft.business.b
file.service.BFile
Service
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.common.model.GridModel
;
import
org.rcisoft.common.model.GridModel
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.result.ResultCode
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
...
@@ -31,9 +29,9 @@ import java.util.List;
...
@@ -31,9 +29,9 @@ import java.util.List;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/BVideo"
)
@RequestMapping
(
"/BVideo"
)
public
class
B
VideoController
extends
PaginationController
<
BVideo
>
{
public
class
B
FileController
extends
PaginationController
<
BFile
>
{
@Autowired
@Autowired
private
B
VideoService
bVideo
Service
;
private
B
FileService
bFile
Service
;
@Autowired
@Autowired
private
Global
global
;
private
Global
global
;
...
@@ -46,12 +44,12 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -46,12 +44,12 @@ public class BVideoController extends PaginationController<BVideo> {
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
B
Video
bVideo
)
{
public
Result
add
(
B
File
bFile
)
{
PersistModel
data
=
b
VideoService
.
persist
(
bVideo
,
getToken
());
PersistModel
data
=
b
FileService
.
persist
(
bFile
,
getToken
());
return
Result
.
builder
(
data
,
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
b
Video
);
b
File
);
}
}
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiOperation
(
value
=
"逻辑删除"
,
notes
=
"根据ID删除一条记录"
)
...
@@ -59,7 +57,7 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -59,7 +57,7 @@ public class BVideoController extends PaginationController<BVideo> {
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/remove"
)
@PostMapping
(
value
=
"/remove"
)
public
Result
remove
(
String
id
)
{
public
Result
remove
(
String
id
)
{
PersistModel
data
=
b
Video
Service
.
removeBVideo
(
id
,
getToken
());
PersistModel
data
=
b
File
Service
.
removeBVideo
(
id
,
getToken
());
return
Result
.
builder
(
data
,
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
@@ -73,7 +71,7 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -73,7 +71,7 @@ public class BVideoController extends PaginationController<BVideo> {
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
b
Video
Service
.
selectOne
(
businessId
));
b
File
Service
.
selectOne
(
businessId
));
}
}
...
@@ -84,9 +82,9 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -84,9 +82,9 @@ public class BVideoController extends PaginationController<BVideo> {
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryBVideosByPagination"
)
@GetMapping
(
value
=
"/queryBVideosByPagination"
)
public
GridModel
queryBVideosByPagination
(
B
Video
param
)
{
public
GridModel
queryBVideosByPagination
(
B
File
param
)
{
param
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
param
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
b
Video
Service
.
queryBVideosByPagination
(
getPaginationUtility
(),
param
);
b
File
Service
.
queryBVideosByPagination
(
getPaginationUtility
(),
param
);
GridModel
gridModel
=
getGridModelResponse
();
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
return
gridModel
;
}
}
...
@@ -98,12 +96,12 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -98,12 +96,12 @@ public class BVideoController extends PaginationController<BVideo> {
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"remarks"
,
value
=
"备注"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryBVideos"
)
@GetMapping
(
value
=
"/queryBVideos"
)
public
Result
queryBVideos
(
B
Video
param
)
{
public
Result
queryBVideos
(
B
File
param
)
{
param
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
param
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
b
Video
Service
.
queryBVideos
(
param
));
b
File
Service
.
queryBVideos
(
param
));
}
}
...
@@ -111,30 +109,14 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -111,30 +109,14 @@ public class BVideoController extends PaginationController<BVideo> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"videoName"
,
value
=
"视频名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"videoName"
,
value
=
"视频名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"videoUrl"
,
value
=
"视频地址"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"videoUrl"
,
value
=
"视频地址"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件
"
,
required
=
fals
e
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"'0'为视频,'1'为附件
,'2'为ppt,'3'为pdf"
,
required
=
tru
e
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"file"
,
value
=
"视频文件"
,
required
=
true
,
dataType
=
"MultipartFile"
)})
@ApiImplicitParam
(
name
=
"file"
,
value
=
"视频文件"
,
required
=
true
,
dataType
=
"MultipartFile"
)})
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
@PostMapping
(
value
=
"/uploadVideo"
)
@PostMapping
(
value
=
"/uploadVideo"
)
public
Result
uploadVideo
(
BVideo
bVideo
,
HttpServletRequest
request
)
{
public
Result
uploadVideo
(
BFile
bFile
,
HttpServletRequest
request
)
{
Result
result
=
new
Result
();
List
<
MultipartFile
>
list
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
List
<
MultipartFile
>
list
=
((
MultipartHttpServletRequest
)
request
).
getFiles
(
"file"
);
try
{
try
{
String
pathName
;
String
videoUrl
=
bFileService
.
uploadVideoToServer
(
list
,
bFile
,
getToken
());
if
(
bVideo
.
getType
().
equals
(
"0"
)){
pathName
=
global
.
getVIDEO_LOCATION
();
//视频路径
}
else
{
pathName
=
global
.
getFILE_LOCATION
();
//文件路径
}
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
pathName
+
File
.
separator
+
bVideo
.
getLessonId
()
+
File
.
separator
;
//根据开课ID区分文件
File
outFile
=
new
File
(
path
);
if
(!
outFile
.
exists
()){
//判断保存路径是否存在,不存在新建
outFile
.
mkdirs
();
}
String
videoUrl
=
bVideoService
.
uploadVideoToServer
(
list
,
bVideo
,
path
,
getToken
());
return
Result
.
builder
(
new
PersistModel
(
1
),
return
Result
.
builder
(
new
PersistModel
(
1
),
"上传成功"
,
"上传成功"
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
@@ -161,7 +143,7 @@ public class BVideoController extends PaginationController<BVideo> {
...
@@ -161,7 +143,7 @@ public class BVideoController extends PaginationController<BVideo> {
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节ID"
,
required
=
true
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"chapterId"
,
value
=
"章节ID"
,
required
=
true
,
dataType
=
"varchar"
)
@PostMapping
(
value
=
"/downloadFile"
)
@PostMapping
(
value
=
"/downloadFile"
)
public
Result
downloadFile
(
String
chapterId
,
HttpServletResponse
response
){
public
Result
downloadFile
(
String
chapterId
,
HttpServletResponse
response
){
B
Video
video
=
bVideo
Service
.
queryFileUrlByChapterId
(
chapterId
);
B
File
video
=
bFile
Service
.
queryFileUrlByChapterId
(
chapterId
);
BufferedInputStream
bis
=
null
;
BufferedInputStream
bis
=
null
;
BufferedOutputStream
bos
=
null
;
BufferedOutputStream
bos
=
null
;
if
(
video
.
getVideoUrl
()!=
""
&&
video
.
getVideoUrl
()!=
null
){
if
(
video
.
getVideoUrl
()!=
""
&&
video
.
getVideoUrl
()!=
null
){
...
...
src/main/java/org/rcisoft/business/bfile/dao/BFileRepository.java
0 → 100644
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
bfile
.
dao
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.business.bfile.entity.BFile
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created with gaowenfneg on 2017-10-9 14:34:56.
*/
@Repository
public
interface
BFileRepository
extends
BaseMapper
<
BFile
>
{
/**
* 根据条件查找
* @param param
* @return
*/
@Select
(
"<script>select * from b_file</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BFile
>
queryBVideos
(
Map
<
String
,
Object
>
param
);
@Select
(
"<script>SELECT * from b_file "
+
"where chapter_id = #{chapterId} </script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BFile
selectInfoByChapterId
(
String
chapterId
);
@Select
(
"<script>SELECT * FROM b_file WHERE chapter_id = #{chapterId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BFile
queryFileUrlByChapterId
(
String
chapterId
);
@Select
(
"<script>SELECT * FROM b_file WHERE chapter_id = #{chapterId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BFile
queryBVideoByChapterId
(
String
chapterId
);
}
src/main/java/org/rcisoft/business/b
video/entity/BVideo
.java
→
src/main/java/org/rcisoft/business/b
file/entity/BFile
.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
b
video
.
entity
;
package
org
.
rcisoft
.
business
.
b
file
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -13,11 +13,11 @@ import javax.persistence.Transient;
...
@@ -13,11 +13,11 @@ import javax.persistence.Transient;
* Created with gaowenfneg on 2017-10-9 14:34:56.
* Created with gaowenfneg on 2017-10-9 14:34:56.
*/
*/
@Entity
@Entity
@Table
(
name
=
"b_
video
"
)
@Table
(
name
=
"b_
file
"
)
@Data
@Data
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
public
class
B
Video
extends
IdEntity
<
BVideo
>
{
public
class
B
File
extends
IdEntity
<
BFile
>
{
private
static
final
long
serialVersionUID
=
5501554322621964535L
;
private
static
final
long
serialVersionUID
=
5501554322621964535L
;
/*视频名称*/
/*视频名称*/
...
@@ -35,10 +35,10 @@ public class BVideo extends IdEntity<BVideo> {
...
@@ -35,10 +35,10 @@ public class BVideo extends IdEntity<BVideo> {
private
String
pdfUrl
;
private
String
pdfUrl
;
@Transient
private
String
lessonId
;
//课程ID
private
String
lessonId
;
//开课ID
private
String
slId
;
//开课ID
@Transient
private
String
chapterId
;
//节ID
private
String
chapterId
;
//节ID
}
}
src/main/java/org/rcisoft/business/b
video/service/BVideo
Service.java
→
src/main/java/org/rcisoft/business/b
file/service/BFile
Service.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
b
video
.
service
;
package
org
.
rcisoft
.
business
.
b
file
.
service
;
import
org.rcisoft.business.b
video.entity.BVideo
;
import
org.rcisoft.business.b
file.entity.BFile
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -10,13 +10,13 @@ import java.util.List;
...
@@ -10,13 +10,13 @@ import java.util.List;
/**
/**
* Created by gaowenfneg on 2017-10-9 14:34:56.
* Created by gaowenfneg on 2017-10-9 14:34:56.
*/
*/
public
interface
B
VideoService
{
public
interface
B
FileService
{
/**
/**
* 根据主键唯一查找
* 根据主键唯一查找
* @param businessId
* @param businessId
* @return
* @return
*/
*/
B
Video
selectOne
(
String
businessId
);
B
File
selectOne
(
String
businessId
);
/**
/**
* 根据条件分页查找
* 根据条件分页查找
...
@@ -24,21 +24,21 @@ public interface BVideoService{
...
@@ -24,21 +24,21 @@ public interface BVideoService{
* @param model
* @param model
* @return
* @return
*/
*/
List
<
B
Video
>
queryBVideosByPagination
(
PageUtil
pageUtil
,
BVideo
model
);
List
<
B
File
>
queryBVideosByPagination
(
PageUtil
pageUtil
,
BFile
model
);
/**
/**
* 根据条件查找全部
* 根据条件查找全部
* @param model
* @param model
* @return
* @return
*/
*/
List
<
B
Video
>
queryBVideos
(
BVideo
model
);
List
<
B
File
>
queryBVideos
(
BFile
model
);
/**
/**
* 插入
* 插入
* @param model
* @param model
* @return
* @return
*/
*/
PersistModel
persist
(
B
Video
model
,
String
token
);
PersistModel
persist
(
B
File
model
,
String
token
);
/**
/**
* 逻辑删除
* 逻辑删除
...
@@ -47,7 +47,7 @@ public interface BVideoService{
...
@@ -47,7 +47,7 @@ public interface BVideoService{
*/
*/
PersistModel
removeBVideo
(
String
id
,
String
token
);
PersistModel
removeBVideo
(
String
id
,
String
token
);
public
String
uploadVideoToServer
(
List
<
MultipartFile
>
list
,
B
Video
bVideo
,
String
path
,
String
token
);
public
String
uploadVideoToServer
(
List
<
MultipartFile
>
list
,
B
File
bFile
,
String
token
);
public
B
Video
queryFileUrlByChapterId
(
String
chapterId
);
public
B
File
queryFileUrlByChapterId
(
String
chapterId
);
}
}
src/main/java/org/rcisoft/business/b
video/service/impl/BVideo
ServiceImpl.java
→
src/main/java/org/rcisoft/business/b
file/service/impl/BFile
ServiceImpl.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
b
video
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
b
file
.
service
.
impl
;
import
org.rcisoft.business.b
video.dao.BVideo
Repository
;
import
org.rcisoft.business.b
file.dao.BFile
Repository
;
import
org.rcisoft.business.b
video.entity.BVideo
;
import
org.rcisoft.business.b
file.entity.BFile
;
import
org.rcisoft.business.b
video.service.BVideo
Service
;
import
org.rcisoft.business.b
file.service.BFile
Service
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.DelStatus
;
import
org.rcisoft.core.constant.DelStatus
;
...
@@ -26,49 +26,48 @@ import java.util.Map;
...
@@ -26,49 +26,48 @@ import java.util.Map;
*/
*/
@Service
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
B
VideoServiceImpl
implements
BVideo
Service
{
public
class
B
FileServiceImpl
implements
BFile
Service
{
@Autowired
@Autowired
private
B
VideoRepository
bVideo
Repository
;
private
B
FileRepository
bFile
Repository
;
@Autowired
@Autowired
private
Global
global
;
private
Global
global
;
@Override
@Override
public
B
Video
selectOne
(
String
businessId
){
public
B
File
selectOne
(
String
businessId
){
return
b
Video
Repository
.
selectByPrimaryKey
(
businessId
);
return
b
File
Repository
.
selectByPrimaryKey
(
businessId
);
}
}
@Override
@Override
public
List
<
B
Video
>
queryBVideosByPagination
(
PageUtil
pageUtil
,
BVideo
model
)
{
public
List
<
B
File
>
queryBVideosByPagination
(
PageUtil
pageUtil
,
BFile
model
)
{
Map
param
=
new
HashMap
<
String
,
Object
>();
Map
param
=
new
HashMap
<
String
,
Object
>();
return
b
Video
Repository
.
queryBVideos
(
param
);
return
b
File
Repository
.
queryBVideos
(
param
);
}
}
@Override
@Override
public
List
<
B
Video
>
queryBVideos
(
BVideo
model
)
{
public
List
<
B
File
>
queryBVideos
(
BFile
model
)
{
Map
param
=
new
HashMap
<
String
,
Object
>();
Map
param
=
new
HashMap
<
String
,
Object
>();
return
b
Video
Repository
.
queryBVideos
(
param
);
return
b
File
Repository
.
queryBVideos
(
param
);
}
}
@Override
@Override
public
PersistModel
persist
(
B
Video
model
,
String
token
){
public
PersistModel
persist
(
B
File
model
,
String
token
){
UserUtil
.
setCurrentPersistOperation
(
model
);
UserUtil
.
setCurrentPersistOperation
(
model
);
int
line
=
bVideoRepository
.
insertSelective
(
model
);
int
line
=
bFileRepository
.
insertSelective
(
model
);
bVideoRepository
.
insertChapterVideo
(
model
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
@Override
@Override
public
PersistModel
removeBVideo
(
String
id
,
String
token
)
{
public
PersistModel
removeBVideo
(
String
id
,
String
token
)
{
B
Video
bVideo
=
bVideo
Repository
.
selectByPrimaryKey
(
id
);
B
File
bFile
=
bFile
Repository
.
selectByPrimaryKey
(
id
);
b
Video
.
setDelFlag
(
DelStatus
.
DELETED
.
getStatus
());
b
File
.
setDelFlag
(
DelStatus
.
DELETED
.
getStatus
());
UserUtil
.
setCurrentMergeOperation
(
b
Video
);
UserUtil
.
setCurrentMergeOperation
(
b
File
);
int
line
=
b
VideoRepository
.
updateByPrimaryKeySelective
(
bVideo
);
int
line
=
b
FileRepository
.
updateByPrimaryKeySelective
(
bFile
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
@Override
@Override
public
String
uploadVideoToServer
(
List
<
MultipartFile
>
list
,
B
Video
bVideo
,
String
path
,
String
token
)
{
public
String
uploadVideoToServer
(
List
<
MultipartFile
>
list
,
B
File
bFile
,
String
token
)
{
String
videoUrl
=
""
;
String
videoUrl
=
""
;
...
@@ -77,20 +76,37 @@ public class BVideoServiceImpl implements BVideoService {
...
@@ -77,20 +76,37 @@ public class BVideoServiceImpl implements BVideoService {
MultipartFile
file
=
list
.
get
(
i
);
MultipartFile
file
=
list
.
get
(
i
);
try
{
try
{
//查询此节是否已有视频或文件
//查询此节是否已有视频或文件
B
Video
video
=
bVideoRepository
.
selectInfoByChapterId
(
bVideo
.
getChapterId
(),
bVideo
.
getType
());
B
File
video
=
bFileRepository
.
selectInfoByChapterId
(
bFile
.
getChapterId
());
if
(
video
!=
null
){
//此节已有视频或文件,将已有的视频或文件放置到temp目录下,然后上传新视频或文件
if
(
video
!=
null
){
//此节已有视频或文件,将已有的视频或文件放置到temp目录下,然后上传新视频或文件
String
oldPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
video
.
getVideoUrl
();
if
(
bFile
.
getType
().
equals
(
"0"
)&&
video
.
getVideoUrl
()!=
null
&&!
video
.
getVideoUrl
().
equals
(
""
)){
this
.
removeVideoToTemp
(
video
.
getVideoUrl
(),
bFile
);
//复制之前视频到temp文件下
this
.
removeVideoToTemp
(
oldPath
,
video
.
getVideoName
(),
video
.
getType
());
//复制之前视频到temp/video文件下
}
if
(
bFile
.
getType
().
equals
(
"1"
)&&
video
.
getFileUrl
()!=
null
&&!
video
.
getFileUrl
().
equals
(
""
)){
BVideo
newVideo
=
this
.
uploadVideo
(
file
,
bVideo
,
path
);
//上传新视频
this
.
removeVideoToTemp
(
video
.
getFileUrl
(),
bFile
);
//复制之前文件到temp文件下
}
if
(
bFile
.
getType
().
equals
(
"2"
)&&
video
.
getPptUrl
()!=
null
&&!
video
.
getPptUrl
().
equals
(
""
)){
this
.
removeVideoToTemp
(
video
.
getPptUrl
(),
bFile
);
//复制之前ppt到temp文件下
}
if
(
bFile
.
getType
().
equals
(
"3"
)&&
video
.
getPdfUrl
()!=
null
&&!
video
.
getPdfUrl
().
equals
(
""
)){
this
.
removeVideoToTemp
(
video
.
getPdfUrl
(),
bFile
);
//复制之前pdf到temp文件下
}
BFile
newVideo
=
this
.
uploadVideo
(
file
,
bFile
);
//上传新文件
newVideo
.
setBusinessId
(
video
.
getBusinessId
());
newVideo
.
setBusinessId
(
video
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
newVideo
);
UserUtil
.
setCurrentMergeOperation
(
newVideo
);
bVideoRepository
.
updateByPrimaryKeySelective
(
newVideo
);
//更新表中信息
bFileRepository
.
updateByPrimaryKeySelective
(
newVideo
);
//更新表中信息
videoUrl
=
newVideo
.
getVideoUrl
();
if
(
bFile
.
getType
().
equals
(
"0"
)){
videoUrl
=
newVideo
.
getVideoUrl
();
}
else
if
(
bFile
.
getType
().
equals
(
"1"
)){
videoUrl
=
newVideo
.
getFileUrl
();
}
else
if
(
bFile
.
getType
().
equals
(
"2"
)){
videoUrl
=
newVideo
.
getPptUrl
();
}
else
{
videoUrl
=
newVideo
.
getPdfUrl
();
}
}
else
{
}
else
{
B
Video
newVideo
=
this
.
uploadVideo
(
file
,
bVideo
,
path
);
//上传新视频
B
File
newVideo
=
this
.
uploadVideo
(
file
,
bFile
);
//上传文件
this
.
persist
(
newVideo
,
token
);
//插入表信息
this
.
persist
(
newVideo
,
token
);
//插入表信息
videoUrl
=
newVideo
.
getVideoUrl
();
videoUrl
=
newVideo
.
getVideoUrl
();
}
}
...
@@ -108,20 +124,36 @@ public class BVideoServiceImpl implements BVideoService {
...
@@ -108,20 +124,36 @@ public class BVideoServiceImpl implements BVideoService {
/**
/**
* 将原视频复制到temp/video文件下,并删除原视频
* 将原视频复制到temp/video文件下,并删除原视频
* @param
oldPath
* @param
url
* @param
videoNam
e
* @param
bFil
e
*/
*/
private
void
removeVideoToTemp
(
String
oldPath
,
String
videoName
,
String
type
)
{
private
void
removeVideoToTemp
(
String
url
,
BFile
bFile
)
{
String
path
;
String
pathName
;
String
pathName
;
if
(
type
==
"0"
){
if
(
bFile
.
getLessonId
()!=
null
&&!
bFile
.
getLessonId
().
equals
(
""
)
){
path
Name
=
global
.
getVIDEO_LOCATION
();
//视频路径
path
=
global
.
getLESSON_LOCATION
()
+
File
.
separator
+
bFile
.
getLessonId
()
+
File
.
separator
;
}
else
{
}
else
{
path
=
global
.
getSL_LOCATION
()
+
File
.
separator
+
bFile
.
getSlId
()
+
File
.
separator
;
}
if
(
bFile
.
getType
().
equals
(
"0"
)){
pathName
=
global
.
getVIDEO_LOCATION
();
//视频路径
}
else
if
(
bFile
.
getType
().
equals
(
"1"
)){
pathName
=
global
.
getFILE_LOCATION
();
//文件路径
pathName
=
global
.
getFILE_LOCATION
();
//文件路径
}
else
if
(
bFile
.
getType
().
equals
(
"2"
)){
pathName
=
global
.
getPPT_LOCATION
();
//ppt路径
}
else
{
pathName
=
global
.
getPDF_LOCATION
();
//pdf路径
}
}
String
tempPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
String
oldPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getTEMP_LOCATION
()
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
pathName
;
+
path
.
substring
(
0
,
path
.
indexOf
(
File
.
separator
))
+
url
;
String
tempPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
global
.
getTEMP_LOCATION
()
+
File
.
separator
+
path
+
bFile
.
getChapterId
()
+
File
.
separator
+
pathName
;
File
filePath
=
new
File
(
tempPath
);
File
filePath
=
new
File
(
tempPath
);
if
(!
filePath
.
exists
()){
if
(!
filePath
.
exists
()){
...
@@ -133,7 +165,7 @@ public class BVideoServiceImpl implements BVideoService {
...
@@ -133,7 +165,7 @@ public class BVideoServiceImpl implements BVideoService {
File
oldfile
=
new
File
(
oldPath
);
File
oldfile
=
new
File
(
oldPath
);
if
(
oldfile
.
exists
())
{
//文件存在时
if
(
oldfile
.
exists
())
{
//文件存在时
InputStream
inStream
=
new
FileInputStream
(
oldPath
);
//读入原文件
InputStream
inStream
=
new
FileInputStream
(
oldPath
);
//读入原文件
FileOutputStream
fs
=
new
FileOutputStream
(
tempPath
+
File
.
separator
+
videoName
);
FileOutputStream
fs
=
new
FileOutputStream
(
tempPath
+
File
.
separator
+
bFile
.
getVideoName
()
);
byte
[]
buffer
=
new
byte
[
1024000
];
byte
[]
buffer
=
new
byte
[
1024000
];
int
length
;
int
length
;
while
(
(
byteread
=
inStream
.
read
(
buffer
))
!=
-
1
)
{
while
(
(
byteread
=
inStream
.
read
(
buffer
))
!=
-
1
)
{
...
@@ -155,20 +187,39 @@ public class BVideoServiceImpl implements BVideoService {
...
@@ -155,20 +187,39 @@ public class BVideoServiceImpl implements BVideoService {
/**
/**
* 上传视频到video目录
* 上传视频到video目录
* @param file
* @param file
* @param bVideo
* @param bFile
* @param path
* @return
* @return
* @throws IOException
* @throws IOException
*/
*/
private
B
Video
uploadVideo
(
MultipartFile
file
,
BVideo
bVideo
,
String
path
)
throws
IOException
{
private
B
File
uploadVideo
(
MultipartFile
file
,
BFile
bFile
)
throws
IOException
{
BufferedOutputStream
stream
=
null
;
BufferedOutputStream
stream
=
null
;
String
path
;
String
pathName
;
String
pathName
;
if
(
bVideo
.
getType
().
equals
(
"0
"
)){
if
(
bFile
.
getLessonId
()!=
null
&&!
bFile
.
getLessonId
().
equals
(
"
"
)){
path
Name
=
global
.
getVIDEO_LOCATION
();
//视频路径
path
=
global
.
getLESSON_LOCATION
()
+
File
.
separator
+
bFile
.
getLessonId
()
+
File
.
separator
;
}
else
{
}
else
{
path
=
global
.
getSL_LOCATION
()
+
File
.
separator
+
bFile
.
getSlId
()
+
File
.
separator
;
}
if
(
bFile
.
getType
().
equals
(
"0"
)){
pathName
=
global
.
getVIDEO_LOCATION
();
//视频路径
}
else
if
(
bFile
.
getType
().
equals
(
"1"
)){
pathName
=
global
.
getFILE_LOCATION
();
//文件路径
pathName
=
global
.
getFILE_LOCATION
();
//文件路径
}
else
if
(
bFile
.
getType
().
equals
(
"2"
)){
pathName
=
global
.
getPPT_LOCATION
();
//ppt路径
}
else
{
pathName
=
global
.
getPDF_LOCATION
();
//pdf路径
}
String
realPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
path
+
bFile
.
getChapterId
()
+
File
.
separator
+
pathName
+
File
.
separator
;
File
outFile
=
new
File
(
realPath
);
if
(!
outFile
.
exists
()){
//判断保存路径是否存在,不存在新建
outFile
.
mkdirs
();
}
}
//上传文件
//上传文件
...
@@ -185,21 +236,22 @@ public class BVideoServiceImpl implements BVideoService {
...
@@ -185,21 +236,22 @@ public class BVideoServiceImpl implements BVideoService {
String
filename
=
uploadFileName
+
"."
+
uploadFileSuffix
;
String
filename
=
uploadFileName
+
"."
+
uploadFileSuffix
;
stream
=
new
BufferedOutputStream
(
new
FileOutputStream
(
new
File
(
p
ath
+
filename
)));
stream
=
new
BufferedOutputStream
(
new
FileOutputStream
(
new
File
(
realP
ath
+
filename
)));
byte
[]
bytes
=
file
.
getBytes
();
byte
[]
bytes
=
file
.
getBytes
();
stream
.
write
(
bytes
,
0
,
bytes
.
length
);
stream
.
write
(
bytes
,
0
,
bytes
.
length
);
String
newPath
=
pathName
String
newPath
=
path
.
substring
(
path
.
indexOf
(
File
.
separator
)+
1
)
+
File
.
separator
+
File
.
separator
+
bVideo
.
getLessonId
()
+
File
.
separator
;
+
bFile
.
getChapterId
()
+
File
.
separator
+
pathName
+
File
.
separator
;
b
Video
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
b
File
.
setVideoName
(
name
+
"."
+
uploadFileSuffix
);
//文件名
b
Video
.
setVideoUrl
(
newPath
+
filename
);
//存储地址
b
File
.
setVideoUrl
(
newPath
+
filename
);
//存储地址
stream
.
close
();
stream
.
close
();
return
b
Video
;
return
b
File
;
}
}
@Override
@Override
public
B
Video
queryFileUrlByChapterId
(
String
chapterId
)
{
public
B
File
queryFileUrlByChapterId
(
String
chapterId
)
{
return
b
Video
Repository
.
queryFileUrlByChapterId
(
chapterId
);
return
b
File
Repository
.
queryFileUrlByChapterId
(
chapterId
);
}
}
}
}
src/main/java/org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
View file @
4b98f49b
package
org
.
rcisoft
.
business
.
bsl
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
bsl
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
...
@@ -135,6 +136,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -135,6 +136,7 @@ public class BSlServiceImpl implements BSlService {
//添加课程方向信息
//添加课程方向信息
direction
.
setBusinessId
(
IdGen
.
uuid
());
direction
.
setBusinessId
(
IdGen
.
uuid
());
direction
.
setSlId
(
model
.
getBusinessId
());
direction
.
setSlId
(
model
.
getBusinessId
());
direction
.
setDirectionId
(
model
.
getDirectionId
());
bLessonRepository
.
insertLessonDirection
(
direction
);
bLessonRepository
.
insertLessonDirection
(
direction
);
if
(
data
!=
0
&&
result
!=
0
){
if
(
data
!=
0
&&
result
!=
0
){
line
=
data
;
line
=
data
;
...
@@ -151,10 +153,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -151,10 +153,7 @@ public class BSlServiceImpl implements BSlService {
ArrayList
<
String
>
repeatCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
repeatCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
lessonCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
lessonCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
teacherCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
teacherCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
gitlab
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
termCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
termCode
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
classHour
=
new
ArrayList
<
String
>();
ArrayList
<
String
>
credits
=
new
ArrayList
<
String
>();
List
<
BSl
>
repeatSl
=
new
ArrayList
<>();
List
<
BSl
>
repeatSl
=
new
ArrayList
<>();
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
...
@@ -166,7 +165,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -166,7 +165,7 @@ public class BSlServiceImpl implements BSlService {
}
}
for
(
String
[]
value:
values
){
//将数据封装到entity
for
(
String
[]
value:
values
){
//将数据封装到entity
if
(
value
.
length
>=
4
)
{
if
(
value
.
length
>=
6
)
{
//1. 检查数据正确性
//1. 检查数据正确性
BSl
bSl
=
null
;
BSl
bSl
=
null
;
BSl
b
=
new
BSl
(
value
[
0
]);
BSl
b
=
new
BSl
(
value
[
0
]);
...
@@ -176,7 +175,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -176,7 +175,7 @@ public class BSlServiceImpl implements BSlService {
bSl1
.
setLessonCode
(
value
[
1
]);
bSl1
.
setLessonCode
(
value
[
1
]);
bSl1
.
setClassHour
(
value
[
4
]);
bSl1
.
setClassHour
(
value
[
4
]);
bSl1
.
setCredits
(
value
[
5
]);
bSl1
.
setCredits
(
value
[
5
]);
if
(
value
[
0
]
==
null
||
value
[
0
].
equals
(
""
)
||
value
[
1
]
==
null
||
value
[
1
].
equals
(
""
))
{
if
(
StringUtils
.
isAnyEmpty
(
value
[
0
]
)
||
value
[
1
]
==
null
||
value
[
1
].
equals
(
""
))
{
continue
;
continue
;
}
}
if
((
bSl
=
bSlRepository
.
selectOne
(
b
))
!=
null
)
{
if
((
bSl
=
bSlRepository
.
selectOne
(
b
))
!=
null
)
{
...
@@ -209,18 +208,6 @@ public class BSlServiceImpl implements BSlService {
...
@@ -209,18 +208,6 @@ public class BSlServiceImpl implements BSlService {
bSl
.
setSlCoverUrl
(
bLessonRepository
.
queryBLessonByCode
(
value
[
1
]).
getDefaultUrl
());
bSl
.
setSlCoverUrl
(
bLessonRepository
.
queryBLessonByCode
(
value
[
1
]).
getDefaultUrl
());
UserUtil
.
setCurrentPersistOperation
(
bSl
);
UserUtil
.
setCurrentPersistOperation
(
bSl
);
//3. 封装git lab
/*User user = userRepository.selectOne(new User(value[2]));
AccountDTO dto = new AccountDTO(user.getGitLabId(),user.getGitLabImpressionToken());
dto.setUsername(user.getGitLabUsername());
if(StringUtils.isEmpty(dto.getId())|| StringUtils.isEmpty(dto.getImpersonationToken())){
gitlab.add(value[2]);
continue;
}
Project project = action.createProject(pName,dto);
bSl.setGitLabProjectId(project.getId());
String pName = global.getGIT_LAB_PROJECT_PREFIX()+value[0];
bSl.setGitLabProjectName(pName);*/
if
(!
bSls
.
contains
(
bSl
))
{
if
(!
bSls
.
contains
(
bSl
))
{
bSls
.
add
(
bSl
);
bSls
.
add
(
bSl
);
}
}
...
@@ -256,18 +243,10 @@ public class BSlServiceImpl implements BSlService {
...
@@ -256,18 +243,10 @@ public class BSlServiceImpl implements BSlService {
if
(
termCode
.
size
()>
0
){
if
(
termCode
.
size
()>
0
){
nullResult
.
append
(
"以下学期编号不存在:"
).
append
(
JSON
.
toJSONString
(
termCode
)).
append
(
"。 "
);
nullResult
.
append
(
"以下学期编号不存在:"
).
append
(
JSON
.
toJSONString
(
termCode
)).
append
(
"。 "
);
}
}
if
(
gitlab
.
size
()>
0
){
nullResult
.
append
(
"以下教师的gitlab账户不存在(请重试新增该教师):"
).
append
(
JSON
.
toJSONString
(
gitlab
));
}
result
+=
nullResult
;
result
+=
nullResult
;
if
(
bSls
.
size
()<
1
){
if
(
bSls
.
size
()<
1
){
throw
new
ServiceException
(
ResultServiceEnums
.
EXCEL_IMPORT_DB_INSERT_ERROR
.
getCode
(),
result
);
throw
new
ServiceException
(
ResultServiceEnums
.
EXCEL_IMPORT_DB_INSERT_ERROR
.
getCode
(),
result
);
}
}
return
new
PersistModel
(
1
,
result
);
return
new
PersistModel
(
1
,
result
);
}
}
...
...
src/main/java/org/rcisoft/business/bvideo/dao/BVideoRepository.java
deleted
100644 → 0
View file @
1836d5d1
package
org
.
rcisoft
.
business
.
bvideo
.
dao
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.business.bvideo.entity.BVideo
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created with gaowenfneg on 2017-10-9 14:34:56.
*/
@Repository
public
interface
BVideoRepository
extends
BaseMapper
<
BVideo
>
{
/**
* 根据条件查找
* @param param
* @return
*/
@Select
(
"<script>select * from b_video</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BVideo
>
queryBVideos
(
Map
<
String
,
Object
>
param
);
@Insert
(
"<script>insert into b_r_chapter_video (video_id,chapter_id,type) values (#{businessId},#{chapterId},#{type})</script>"
)
int
insertChapterVideo
(
BVideo
model
);
@Select
(
"<script>SELECT\n"
+
"\tbv.* from b_video bv\n"
+
"\tLEFT JOIN b_r_chapter_video bcv on bcv.video_id = bv.business_id\n"
+
"\twhere bcv.chapter_id = #{0} "
+
"and bcv.type = #{1}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BVideo
selectInfoByChapterId
(
String
chapterId
,
String
type
);
@Select
(
"<script>SELECT\n"
+
"\tbv.*\n"
+
"FROM\n"
+
"\tb_video bv\n"
+
"LEFT JOIN b_r_chapter_video brc ON bv.business_id = brc.video_id\n"
+
"WHERE\n"
+
"\tbrc.chapter_id = #{chapterId}\n"
+
"AND brc.type = '1'</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BVideo
queryFileUrlByChapterId
(
String
chapterId
);
@Select
(
"<script>SELECT\n"
+
"\tbv.*\n"
+
"FROM\n"
+
"\tb_video bv\n"
+
"LEFT JOIN b_r_chapter_video brc ON bv.business_id = brc.video_id\n"
+
"WHERE\n"
+
"\tbrc.chapter_id = #{chapterId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
BVideo
queryBVideoByChapterId
(
String
chapterId
);
}
src/main/java/org/rcisoft/common/component/Global.java
View file @
4b98f49b
...
@@ -68,6 +68,14 @@ public class Global {
...
@@ -68,6 +68,14 @@ public class Global {
@Value
(
"${global.path.file_location}"
)
@Value
(
"${global.path.file_location}"
)
private
String
FILE_LOCATION
;
private
String
FILE_LOCATION
;
/*ppt路径*/
@Value
(
"${global.path.ppt_location}"
)
private
String
PPT_LOCATION
;
/*pdf路径*/
@Value
(
"${global.path.pdf_location}"
)
private
String
PDF_LOCATION
;
/*excel模板位置*/
/*excel模板位置*/
@Value
(
"${global.path.excel_template_location}"
)
@Value
(
"${global.path.excel_template_location}"
)
private
String
EXCEL_TEMPLATE_LOCATION
;
private
String
EXCEL_TEMPLATE_LOCATION
;
...
...
src/main/resources/application-dev.yml
View file @
4b98f49b
...
@@ -107,9 +107,11 @@ global:
...
@@ -107,9 +107,11 @@ global:
sl_location
:
sl
sl_location
:
sl
freemarker_location
:
/freemarker
freemarker_location
:
/freemarker
image_location
:
/upload
image_location
:
/upload
video_location
:
/video
video_location
:
video
temp_location
:
/temp
temp_location
:
temp
file_location
:
/file
file_location
:
file
ppt_location
:
ppt
pdf_location
:
pdf
excel_template_location
:
excel-template/
excel_template_location
:
excel-template/
cource_logo_location
:
/course/logo
cource_logo_location
:
/course/logo
images_location
:
/images
images_location
:
/images
...
...
src/main/resources/mapper/business/b
video/mapper/BVideo
Mapper.xml
→
src/main/resources/mapper/business/b
file/mapper/BFile
Mapper.xml
View file @
4b98f49b
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.b
video.dao.BVideo
Repository"
>
<mapper
namespace=
"org.rcisoft.business.b
file.dao.BFile
Repository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.b
video.entity.BVideo
"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.b
file.entity.BFile
"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
...
@@ -16,5 +16,8 @@
...
@@ -16,5 +16,8 @@
<result
column=
"ppt_url"
jdbcType=
"VARCHAR"
property=
"pptUrl"
/>
<result
column=
"ppt_url"
jdbcType=
"VARCHAR"
property=
"pptUrl"
/>
<result
column=
"pdf_url"
jdbcType=
"VARCHAR"
property=
"pdfUrl"
/>
<result
column=
"pdf_url"
jdbcType=
"VARCHAR"
property=
"pdfUrl"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"chapter_id"
jdbcType=
"VARCHAR"
property=
"chapterId"
/>
<result
column=
"sl_id"
jdbcType=
"VARCHAR"
property=
"slId"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
</resultMap>
</resultMap>
</mapper>
</mapper>
\ 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