Commit 7b1cc9a2 authored by zhangqingle's avatar zhangqingle

Merge remote-tracking branch 'origin/meiteng' into zql

parents 72161853 5c2a5eb7
...@@ -373,21 +373,24 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -373,21 +373,24 @@ public class BChapterServiceImpl implements BChapterService {
// 更新 学生针对此章节的中间表 // 更新 学生针对此章节的中间表
List<BRStudentChapter> brStudentChapterList = brStudentChapterRepository.queryByStuIdAndChapter(chapterDTO.getBusinessId(), ""); List<BRStudentChapter> brStudentChapterList = brStudentChapterRepository.queryByStuIdAndChapter(chapterDTO.getBusinessId(), "");
for (BRStudentChapter studentChapter: brStudentChapterList){ for (BRStudentChapter studentChapter: brStudentChapterList){
double learnProgress = Double.parseDouble(lessonPerson.getLearnProgress().split("%")[0]) / 100 ; if (lessonPerson.getPersonId().equals(studentChapter.getStudentId())) {
double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour())));
if (newLearnProgress == 0){ double learnProgress = Double.parseDouble(lessonPerson.getLearnProgress().split("%")[0]) / 100;
lessonPerson.setIsFinish("0"); double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour())));
lessonPerson.setFinishDate(null); if (newLearnProgress == 0) {
lessonPerson.setIsFinish("0");
lessonPerson.setFinishDate(null);
}
if (0 < newLearnProgress && newLearnProgress < 1) {
lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null);
}
lessonPerson.setLearnProgress(newLearnProgress * 100 + "%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
studentChapter.setProgress(0);
studentChapter.setCurrentLocation(0);
brStudentChapterRepository.updateById(studentChapter);
} }
if (0 < newLearnProgress && newLearnProgress < 1){
lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null);
}
lessonPerson.setLearnProgress(newLearnProgress*100 + "%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
studentChapter.setProgress(0);
studentChapter.setCurrentLocation(0);
brStudentChapterRepository.updateById(studentChapter);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment