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
85dc8044
Commit
85dc8044
authored
Nov 07, 2019
by
王淑君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
bfc6e277
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
35 deletions
+22
-35
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+2
-2
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+18
-31
StudentTrackingChartDTO.java
...rcisoft/business/blesson/dto/StudentTrackingChartDTO.java
+2
-2
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
85dc8044
...
...
@@ -144,8 +144,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"AND t1.del_flag = 0 and t1.flag = 1</script>"
)
List
<
StuScoreDTO
>
selectScoreListBySlIdAndStuId
(
@Param
(
"slid"
)
String
slid
,
@Param
(
"stuid"
)
String
stuid
);
//
@Delete("<script>delete from b_r_student_chapter where chapter_id = #{chapterId}</script>")
//
int deleteStudentChapter(String chapterId);
@Delete
(
"<script>delete from b_r_student_chapter where chapter_id = #{chapterId}</script>"
)
int
deleteStudentChapter
(
String
chapterId
);
/**
* 根据章节id和学生id获取主键
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
85dc8044
...
...
@@ -154,22 +154,17 @@ public class BChapterServiceImpl implements BChapterService {
if
(
bLesson
==
null
){
throw
new
ServiceException
(
ResultServiceEnums
.
LESSON_NOT_EXISTA
);
}
//
//判断课程是否被关闭
//
if ("4".equals(bLesson.getReleaseState())){
//
throw new ServiceException(ResultServiceEnums.LESSON_CLOSED);
//
}
//判断课程是否被关闭
if
(
"4"
.
equals
(
bLesson
.
getReleaseState
())){
throw
new
ServiceException
(
ResultServiceEnums
.
LESSON_CLOSED
);
}
//判断该登录人是否可见该课程
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
mtCotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
List
<
String
>
departs
=
new
ArrayList
<>();
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
){
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
List
<
String
>
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
int
result
=
bLessonRepository
.
isInViewRange
(
curUser
,
lessonId
,
departs
);
if
(
result
<
1
){
throw
new
ServiceException
(
ResultServiceEnums
.
NO_ACCESS
);
...
...
@@ -300,19 +295,18 @@ public class BChapterServiceImpl implements BChapterService {
UserUtil
.
setCurrentMergeOperation
(
model
);
bFile
.
setChapterId
(
model
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
bFile
);
model
.
setCourseTime
(
dto
.
getFileTime
());
model
.
setIsTest
(
dto
.
getType
());
if
(
StringUtils
.
isNotEmpty
(
dto
.
getFileTime
())
&&
dto
.
getFileTime
().
contains
(
"."
))
{
model
.
setCourseTime
(
dto
.
getFileTime
().
substring
(
0
,
dto
.
getFileTime
().
lastIndexOf
(
"."
)));
bFile
.
setFileTime
(
dto
.
getFileTime
().
substring
(
0
,
dto
.
getFileTime
().
lastIndexOf
(
"."
)));
}
//先判断该课程的第一节是否是本节 更新blesson表中course_time字段
String
cid
=
bChapterRepository
.
getFirstChapter
(
model
.
getLessonId
());
log
.
debug
(
"--------------------------------第一节id--------:"
+
cid
);
log
.
debug
(
"------------------------------当前章节id--------:"
+
model
.
getBusinessId
());
if
(
model
.
getBusinessId
().
equals
(
cid
))
{
int
linex
=
bChapterRepository
.
updateVideoTimeInLesson
(
model
.
getCourseTime
(),
model
.
getLessonId
());
log
.
debug
(
"----------------------更新lesson表中第一节时长--"
+(
linex
==
0
?
"失败"
:
"成功"
)+
"----------"
);
log
.
debug
(
"--------------------------时长-----------:"
+
model
.
getCourseTime
());
bChapterRepository
.
updateVideoTimeInLesson
(
model
.
getCourseTime
(),
model
.
getLessonId
());
}
line
=
bChapterRepository
.
updateByPrimaryKeySelective
(
model
);
...
...
@@ -339,7 +333,6 @@ public class BChapterServiceImpl implements BChapterService {
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
lessonPerson
);
studentChapter
.
setProgress
(
0
);
brStudentChapterRepository
.
updateById
(
studentChapter
);
}
}
}
...
...
@@ -388,13 +381,13 @@ public class BChapterServiceImpl implements BChapterService {
if
(
learnProgress
>
0
&&
newLearnProgress
<
0.01
){
newLearnProgress
=
0.01f
;
}
if
(
"2"
.
equals
(
lessonPerson
.
getIsFinish
())){
if
(
newLearnProgress
<
1
)
lessonPerson
.
setIsFinish
(
"1"
);
else
{
lessonPerson
.
setIsFinish
(
"2"
);
lessonPerson
.
setLearnProgress
(
"100%"
)
;
}
if
(
"2"
.
equals
(
lessonPerson
.
getIsFinish
())
&&
newLearnProgress
<
1
){
lessonPerson
.
setIsFinish
(
"1"
);
}
if
(
newLearnProgress
>=
1
){
newLearnProgress
=
1
;
lessonPerson
.
setIsFinish
(
"2"
);
}
lessonPerson
.
setLearnProgress
(
newLearnProgress
*
100
+
"%"
);
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
lessonPerson
);
...
...
@@ -412,21 +405,15 @@ 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
);
BLesson
bLesson
=
bLessonRepository
.
selectByPrimaryKey
(
lessonId
);
if
(
"2"
.
equals
(
bLesson
.
getReleaseState
())
&&
chapterCount
==
1
){
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_ONLY_ONE
);
}
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
);
...
...
@@ -436,7 +423,7 @@ public class BChapterServiceImpl implements BChapterService {
String
secondId
=
bChapterRepository
.
getFirstChapter
(
lessonId
);
String
time
=
bChapterRepository
.
getTimeByChapterId
(
secondId
);
//更新到b_lesson 表
bChapterRepository
.
update
VideoTimeIn
Lesson
(
time
,
lessonId
);
bChapterRepository
.
update
CourseTimeFor
Lesson
(
time
,
lessonId
);
// 更新学生 对应章节总进度
this
.
updateLessonProgress
(
lessonId
,
false
);
//删除student_chapter表中数据
...
...
src/main/java/org/rcisoft/business/blesson/dto/StudentTrackingChartDTO.java
View file @
85dc8044
...
...
@@ -9,8 +9,8 @@ public class StudentTrackingChartDTO {
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
false
)
private
String
lessonId
;
//
@ApiModelProperty(value = "课程来源(是否为指派,0自选(选修) 1指派(必修))",required = false)
//
private String isAppoint;
@ApiModelProperty
(
value
=
"课程来源(是否为指派,0自选(选修) 1指派(必修))"
,
required
=
false
)
private
String
isAppoint
;
private
String
userId
;
...
...
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