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
e2aa1a56
Commit
e2aa1a56
authored
Nov 06, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除发布限定
parent
332eb49b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+3
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+8
-1
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+7
-0
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+2
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
e2aa1a56
...
...
@@ -406,5 +406,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
@Delete
(
"delete from b_r_student_chapter where chapter_id = #{chapterId} and student_id = #{uid} "
)
int
deleteBStudentChapter
(
@Param
(
"chapterId"
)
String
chapterId
,
@Param
(
"uid"
)
String
uid
);
@Select
(
"select count(0) from b_chapter where lesson_id = #{lessonId} and chapter_level = 2 and del_flag != 1 and flag =1"
)
int
getlessonHours
(
@Param
(
"lessonId"
)
String
lessonId
);
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
e2aa1a56
...
...
@@ -399,15 +399,22 @@ public class BChapterServiceImpl implements BChapterService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBChapter
(
String
id
,
String
userId
)
{
BChapter
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
id
);
String
lessonId
=
bChapterRepository
.
getLessonIdBychaperId
(
id
);
if
(
bChapter
==
null
)
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_NOT_EXISTS
);
int
chapterCount
=
bChapterRepository
.
getlessonHours
(
lessonId
);
if
(
chapterCount
==
1
){
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_ONLY_ONE
);
}
String
firstChapter
=
bChapterRepository
.
getFirstChapter
(
id
);
List
<
QueryChapterListResDTO
>
childList
=
bChapterRepository
.
queryBChaptersByPid
(
id
);
boolean
hasChild
=
childList
!=
null
&&
childList
.
size
()
>
0
;
boolean
isChapter
=
bChapter
.
getChapterLevel
()
==
ChapterLevelEnum
.
CHAPTER
.
getCode
();
if
(
isChapter
&&
hasChild
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_HAS_CHILD
);
}
String
lessonId
=
bChapterRepository
.
getLessonIdBychaperId
(
id
);
//获取第一节课的id 与当前id对比
String
firstId
=
bChapterRepository
.
getFirstChapter
(
lessonId
);
int
line
=
bChapterRepository
.
removeByPrimaryKey
(
id
);
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
e2aa1a56
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bcourse.dao.BCourseRepository
;
import
org.rcisoft.business.bcourse.dto.AllCourseDTO
;
import
org.rcisoft.business.bfile.dao.BTrainFileRepository
;
...
...
@@ -83,6 +84,9 @@ public class BLessonServiceImpl implements BLessonService {
@Autowired
private
BMaterialRepository
bMaterialRepository
;
@Autowired
private
BChapterRepository
bChapterRepository
;
@Autowired
MTCotactApiRequestClient
cotactApiRequestClient
;
...
...
@@ -460,6 +464,9 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
releaseBLesson
(
String
id
)
{
if
(
bChapterRepository
.
getlessonHours
(
id
)
==
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
LESSON_NO_CHAPTER
);
}
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
id
);
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
bLesson
);
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
e2aa1a56
...
...
@@ -231,6 +231,8 @@ public enum ResultServiceEnums {
LESSON_CLOSED
(
131
,
"该课程已关闭"
),
NO_ACCESS
(
132
,
"您对该课程无可见权限"
),
LABEL_MORE_NUM
(
133
,
"标签超过规定个数"
),
CHAPTER_ONLY_ONE
(
134
,
"当前课程仅有一节,不能被删除"
),
LESSON_NO_CHAPTER
(
134
,
"当前课程暂无章节,不能被发布"
),
;
private
Integer
code
;
...
...
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