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
b8cd62a8
Commit
b8cd62a8
authored
Apr 13, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改对章的操作
parent
bbd508e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+3
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+15
-7
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
b8cd62a8
...
@@ -31,6 +31,9 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -31,6 +31,9 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"SELECT video_url from b_file where chapter_id = #{businessId})"
)
"SELECT video_url from b_file where chapter_id = #{businessId})"
)
int
removeByPrimaryKey
(
@Param
(
"businessId"
)
String
businessId
);
int
removeByPrimaryKey
(
@Param
(
"businessId"
)
String
businessId
);
@Update
(
"update b_chapter set del_flag = '1' where business_id = #{businessId}"
)
int
removeChapter
(
@Param
(
"businessId"
)
String
businessId
);
/**
/**
* 根据id更新添加视频的时长
* 根据id更新添加视频的时长
*
*
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
b8cd62a8
...
@@ -412,16 +412,16 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -412,16 +412,16 @@ public class BChapterServiceImpl implements BChapterService {
}
}
}
else
{
//修改
}
else
{
//修改
BFile
bFileOld
=
bFileRepository
.
selectInfoByChapterId
(
chapterDTO
.
getBusinessId
());
BFile
bFileOld
=
bFileRepository
.
selectInfoByChapterId
(
chapterDTO
.
getBusinessId
());
if
(
model
.
getChapterLevel
()
==
1
)
{
int
x
=
bChapterRepository
.
updateChapterName
(
model
.
getChapterName
(),
model
.
getBusinessId
());
return
new
PersistModel
(
x
);
}
if
(
bFileOld
.
getVideoUrl
().
equals
(
dto
.
getVideoUrl
())){
if
(
bFileOld
.
getVideoUrl
().
equals
(
dto
.
getVideoUrl
())){
dto
.
setPdfNum
(
"0"
);
dto
.
setPdfNum
(
"0"
);
}
}
if
(
"3"
.
equals
(
dto
.
getType
())
&&
dto
.
getPdfNum
()!=
null
&&
!
""
.
equals
(
dto
.
getPdfNum
())
&&
Integer
.
parseInt
(
dto
.
getPdfNum
())
>
1
){
if
(
"3"
.
equals
(
dto
.
getType
())
&&
dto
.
getPdfNum
()!=
null
&&
!
""
.
equals
(
dto
.
getPdfNum
())
&&
Integer
.
parseInt
(
dto
.
getPdfNum
())
>
1
){
model
.
setChapterName
(
model
.
getChapterName
()+
"-1"
);
model
.
setChapterName
(
model
.
getChapterName
()+
"-1"
);
}
}
if
(
model
.
getChapterLevel
()
==
1
)
{
int
x
=
bChapterRepository
.
updateChapterName
(
model
.
getChapterName
(),
model
.
getBusinessId
());
return
new
PersistModel
(
x
);
}
UserUtil
.
setCurrentMergeOperation
(
model
);
UserUtil
.
setCurrentMergeOperation
(
model
);
bFile
.
setChapterId
(
model
.
getBusinessId
());
bFile
.
setChapterId
(
model
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
bFile
);
UserUtil
.
setCurrentMergeOperation
(
bFile
);
...
@@ -654,9 +654,13 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -654,9 +654,13 @@ public class BChapterServiceImpl implements BChapterService {
@Override
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBChapter
(
String
oldId
,
CurUser
curUser
)
{
public
PersistModel
removeBChapter
(
String
oldId
,
CurUser
curUser
)
{
//根据章节id 获取与该章节oss地址相同的第一个章节id
BChapter
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
oldId
);
String
id
=
bChapterRepository
.
getFirstOssId
(
oldId
);
String
id
=
oldId
;
BChapter
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
id
);
if
(
bChapter
.
getChapterLevel
()
!=
1
){
//根据章节id 获取与该节oss地址相同的第一个节id
id
=
bChapterRepository
.
getFirstOssId
(
oldId
);
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
id
);
}
String
lessonId
=
bChapterRepository
.
getLessonIdBychaperId
(
id
);
String
lessonId
=
bChapterRepository
.
getLessonIdBychaperId
(
id
);
if
(
bChapter
==
null
)
if
(
bChapter
==
null
)
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_NOT_EXISTS
);
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_NOT_EXISTS
);
...
@@ -672,6 +676,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -672,6 +676,10 @@ public class BChapterServiceImpl implements BChapterService {
if
(
isChapter
&&
hasChild
)
{
if
(
isChapter
&&
hasChild
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_HAS_CHILD
);
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_HAS_CHILD
);
}
}
if
(
isChapter
){
int
line
=
bChapterRepository
.
removeChapter
(
id
);
return
new
PersistModel
(
line
);
}
//获取第一节课的id 与当前id对比
//获取第一节课的id 与当前id对比
String
firstId
=
bChapterRepository
.
getFirstChapter
(
lessonId
);
String
firstId
=
bChapterRepository
.
getFirstChapter
(
lessonId
);
int
line
=
bChapterRepository
.
removeByPrimaryKey
(
id
);
int
line
=
bChapterRepository
.
removeByPrimaryKey
(
id
);
...
...
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