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
dfd8fd8b
Commit
dfd8fd8b
authored
Dec 05, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into meiteng
parents
c2cbddc6
c94d6b30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+20
-8
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+1
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
dfd8fd8b
...
...
@@ -308,8 +308,11 @@ public class BChapterServiceImpl implements BChapterService {
//上传文件数据插入到bfile表中
int
x
=
bFileRepository
.
insertUploadFile
(
bFile
);
bChapterRepository
.
updateClassHourInLesson
(
model
.
getLessonId
());
//更新b_lesson表中 class_hour
// 更新课程总进度
this
.
updateLessonProgress
(
chapterDTO
.
getLessonId
(),
true
,
0
);
// 新增节 才更新进度
if
(
2
==
chapterDTO
.
getChapterLevel
()){
// 更新课程总进度
this
.
updateLessonProgress
(
chapterDTO
.
getLessonId
(),
true
,
0
);
}
log
.
debug
(
"-----------------------------更新课时成功-------------------"
);
}
}
else
{
...
...
@@ -400,6 +403,9 @@ public class BChapterServiceImpl implements BChapterService {
// lessonPerson.setFinishDate(null);
lessonPerson
.
setFinishDateSetNull
(
"1"
);
}
// 规避 复数 和超100% 的情况
newLearnProgress
=
newLearnProgress
>
1
?
1
:
newLearnProgress
<
0
?
0
:
newLearnProgress
;
lessonPerson
.
setLearnProgress
(
newLearnProgress
*
100
+
"%"
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
studentChapter
.
setProgress
(
0
);
...
...
@@ -456,7 +462,6 @@ public class BChapterServiceImpl implements BChapterService {
}
else
{
int
oldClassHour
=
Integer
.
parseInt
(
bLesson
.
getClassHour
())
+
1
;
newLearnProgress
=
numberFormat
.
format
((
learnProgress
*
oldClassHour
-
delProgress
)/(
oldClassHour
-
1
)
);
// newLearnProgress = numberFormat.format(learnProgress - delProgress/ (Integer.parseInt(bLesson.getClassHour()) + 1));
}
if
(
0
==
Double
.
parseDouble
(
newLearnProgress
)){
lessonPerson
.
setIsFinish
(
"0"
);
...
...
@@ -483,6 +488,9 @@ public class BChapterServiceImpl implements BChapterService {
bLessonServiceImpl
.
addValueEvent
(
lessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
lessonPerson
.
setEverFinished
(
"1"
);
}
// 规避 复数 和超100% 的情况
float
tempTotalProgress
=
Float
.
parseFloat
(
newLearnProgress
);
newLearnProgress
=
String
.
valueOf
(
tempTotalProgress
>
1
?
1
:
tempTotalProgress
<
0
?
0
:
tempTotalProgress
);
lessonPerson
.
setLearnProgress
(
Float
.
parseFloat
(
newLearnProgress
)*
100
+
"%"
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
...
...
@@ -541,12 +549,16 @@ public class BChapterServiceImpl implements BChapterService {
bChapterRepository
.
updateSort
(
params
);
}
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
id
,
userId
);
double
oldProgress
=
0
;
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()>
0
){
oldProgress
=
brStudentChapterList
.
get
(
0
).
getProgress
();
// 判断 2-节 才重新计算进度
if
(
2
==
bChapter
.
getChapterLevel
()){
double
oldProgress
=
0
;
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()>
0
){
oldProgress
=
brStudentChapterList
.
get
(
0
).
getProgress
();
}
// 更新学生 对应章节总进度
this
.
updateLessonProgress
(
lessonId
,
false
,
oldProgress
);
}
// 更新学生 对应章节总进度
this
.
updateLessonProgress
(
lessonId
,
false
,
oldProgress
);
//删除student_chapter表中数据
bChapterRepository
.
deleteBStudentChapter
(
id
,
userId
);
...
...
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
dfd8fd8b
...
...
@@ -123,6 +123,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
if
(
i
==
0
){
totalProgress
=
"0%"
;
}
else
{
// 规避 复数 和超100% 的情况
float
tempTotalProgress
=
Float
.
parseFloat
(
numberFormat
.
format
((
float
)
percent
/
(
float
)
i
*
100
));
totalProgress
=
tempTotalProgress
>
100
?
"100%"
:
tempTotalProgress
<
0
?
"0%"
:
tempTotalProgress
+
"%"
;
// totalProgress = tempTotalProgress + "%";
...
...
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