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
4e51cb2c
Commit
4e51cb2c
authored
Dec 05, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into zql
parents
9123e7d1
dfd8fd8b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
+31
-11
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+3
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+24
-8
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+4
-3
No files found.
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
4e51cb2c
...
@@ -435,5 +435,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
...
@@ -435,5 +435,8 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
"</foreach>"
+
"</foreach>"
+
"</script>"
)
"</script>"
)
int
updateSort
(
@Param
(
"map"
)
List
<
Map
<
String
,
Object
>>
map
);
int
updateSort
(
@Param
(
"map"
)
List
<
Map
<
String
,
Object
>>
map
);
@Update
(
"update b_chapter set chapter_name = #{name} where business_id = #{id}"
)
int
updateChapterName
(
@Param
(
"name"
)
String
name
,
@Param
(
"id"
)
String
id
);
}
}
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
4e51cb2c
...
@@ -308,12 +308,19 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -308,12 +308,19 @@ public class BChapterServiceImpl implements BChapterService {
//上传文件数据插入到bfile表中
//上传文件数据插入到bfile表中
int
x
=
bFileRepository
.
insertUploadFile
(
bFile
);
int
x
=
bFileRepository
.
insertUploadFile
(
bFile
);
bChapterRepository
.
updateClassHourInLesson
(
model
.
getLessonId
());
//更新b_lesson表中 class_hour
bChapterRepository
.
updateClassHourInLesson
(
model
.
getLessonId
());
//更新b_lesson表中 class_hour
// 新增节 才更新进度
if
(
2
==
chapterDTO
.
getChapterLevel
()){
// 更新课程总进度
// 更新课程总进度
this
.
updateLessonProgress
(
chapterDTO
.
getLessonId
(),
true
,
0
);
this
.
updateLessonProgress
(
chapterDTO
.
getLessonId
(),
true
,
0
);
}
log
.
debug
(
"-----------------------------更新课时成功-------------------"
);
log
.
debug
(
"-----------------------------更新课时成功-------------------"
);
}
}
}
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
);
}
UserUtil
.
setCurrentMergeOperation
(
model
);
UserUtil
.
setCurrentMergeOperation
(
model
);
bFile
.
setChapterId
(
model
.
getBusinessId
());
bFile
.
setChapterId
(
model
.
getBusinessId
());
UserUtil
.
setCurrentMergeOperation
(
bFile
);
UserUtil
.
setCurrentMergeOperation
(
bFile
);
...
@@ -396,6 +403,9 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -396,6 +403,9 @@ public class BChapterServiceImpl implements BChapterService {
// lessonPerson.setFinishDate(null);
// lessonPerson.setFinishDate(null);
lessonPerson
.
setFinishDateSetNull
(
"1"
);
lessonPerson
.
setFinishDateSetNull
(
"1"
);
}
}
// 规避 复数 和超100% 的情况
newLearnProgress
=
newLearnProgress
>
1
?
1
:
newLearnProgress
<
0
?
0
:
newLearnProgress
;
lessonPerson
.
setLearnProgress
(
newLearnProgress
*
100
+
"%"
);
lessonPerson
.
setLearnProgress
(
newLearnProgress
*
100
+
"%"
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
studentChapter
.
setProgress
(
0
);
studentChapter
.
setProgress
(
0
);
...
@@ -452,7 +462,6 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -452,7 +462,6 @@ public class BChapterServiceImpl implements BChapterService {
}
else
{
}
else
{
int
oldClassHour
=
Integer
.
parseInt
(
bLesson
.
getClassHour
())
+
1
;
int
oldClassHour
=
Integer
.
parseInt
(
bLesson
.
getClassHour
())
+
1
;
newLearnProgress
=
numberFormat
.
format
((
learnProgress
*
oldClassHour
-
delProgress
)/(
oldClassHour
-
1
)
);
newLearnProgress
=
numberFormat
.
format
((
learnProgress
*
oldClassHour
-
delProgress
)/(
oldClassHour
-
1
)
);
// newLearnProgress = numberFormat.format(learnProgress - delProgress/ (Integer.parseInt(bLesson.getClassHour()) + 1));
}
}
if
(
0
==
Double
.
parseDouble
(
newLearnProgress
)){
if
(
0
==
Double
.
parseDouble
(
newLearnProgress
)){
lessonPerson
.
setIsFinish
(
"0"
);
lessonPerson
.
setIsFinish
(
"0"
);
...
@@ -479,6 +488,9 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -479,6 +488,9 @@ public class BChapterServiceImpl implements BChapterService {
bLessonServiceImpl
.
addValueEvent
(
lessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
bLessonServiceImpl
.
addValueEvent
(
lessonPerson
.
getPersonId
(),
bPersonValue
,
null
);
lessonPerson
.
setEverFinished
(
"1"
);
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
+
"%"
);
lessonPerson
.
setLearnProgress
(
Float
.
parseFloat
(
newLearnProgress
)*
100
+
"%"
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
bLessonPersonRepository
.
updateAtChapter
(
lessonPerson
);
...
@@ -537,12 +549,16 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -537,12 +549,16 @@ public class BChapterServiceImpl implements BChapterService {
bChapterRepository
.
updateSort
(
params
);
bChapterRepository
.
updateSort
(
params
);
}
}
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
id
,
userId
);
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
id
,
userId
);
// 判断 2-节 才重新计算进度
if
(
2
==
bChapter
.
getChapterLevel
()){
double
oldProgress
=
0
;
double
oldProgress
=
0
;
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()>
0
){
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()>
0
){
oldProgress
=
brStudentChapterList
.
get
(
0
).
getProgress
();
oldProgress
=
brStudentChapterList
.
get
(
0
).
getProgress
();
}
}
// 更新学生 对应章节总进度
// 更新学生 对应章节总进度
this
.
updateLessonProgress
(
lessonId
,
false
,
oldProgress
);
this
.
updateLessonProgress
(
lessonId
,
false
,
oldProgress
);
}
//删除student_chapter表中数据
//删除student_chapter表中数据
bChapterRepository
.
deleteBStudentChapter
(
id
,
userId
);
bChapterRepository
.
deleteBStudentChapter
(
id
,
userId
);
...
...
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
4e51cb2c
...
@@ -67,7 +67,6 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
...
@@ -67,7 +67,6 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
@Override
@Override
public
PersistModel
save
(
BRStudentChapterDto
brStudentChapterDto
,
CurUser
curUser
){
public
PersistModel
save
(
BRStudentChapterDto
brStudentChapterDto
,
CurUser
curUser
){
int
line
=
0
;
int
line
=
0
;
// DecimalFormat df=new DecimalFormat("0.00");//设置保留位数
NumberFormat
numberFormat
=
NumberFormat
.
getInstance
();
NumberFormat
numberFormat
=
NumberFormat
.
getInstance
();
numberFormat
.
setMaximumFractionDigits
(
0
);
numberFormat
.
setMaximumFractionDigits
(
0
);
// 查詢是否已經開始觀看此章節
// 查詢是否已經開始觀看此章節
...
@@ -124,8 +123,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
...
@@ -124,8 +123,10 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
if
(
i
==
0
){
if
(
i
==
0
){
totalProgress
=
"0%"
;
totalProgress
=
"0%"
;
}
else
{
}
else
{
totalProgress
=
numberFormat
.
format
((
float
)
percent
/
(
float
)
i
*
100
)
+
"%"
;
// 规避 复数 和超100% 的情况
// totalProgress = df.format((float) ((percent / i) * 100)) + "%";
float
tempTotalProgress
=
Float
.
parseFloat
(
numberFormat
.
format
((
float
)
percent
/
(
float
)
i
*
100
));
totalProgress
=
tempTotalProgress
>
100
?
"100%"
:
tempTotalProgress
<
0
?
"0%"
:
tempTotalProgress
+
"%"
;
// totalProgress = tempTotalProgress + "%";
};
};
// 判斷是否已經開始觀看此課程
// 判斷是否已經開始觀看此課程
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
&&
bLessonPersonList
.
get
(
0
)
!=
null
){
if
(
null
!=
bLessonPersonList
&&
bLessonPersonList
.
size
()
>
0
&&
bLessonPersonList
.
get
(
0
)
!=
null
){
...
...
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