Commit 7b1cc9a2 authored by zhangqingle's avatar zhangqingle

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

parents 72161853 5c2a5eb7
...@@ -373,17 +373,19 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -373,17 +373,19 @@ 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 learnProgress = Double.parseDouble(lessonPerson.getLearnProgress().split("%")[0]) / 100;
double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour()))); double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour())));
if (newLearnProgress == 0){ if (newLearnProgress == 0) {
lessonPerson.setIsFinish("0"); lessonPerson.setIsFinish("0");
lessonPerson.setFinishDate(null); lessonPerson.setFinishDate(null);
} }
if (0 < newLearnProgress && newLearnProgress < 1){ if (0 < newLearnProgress && newLearnProgress < 1) {
lessonPerson.setIsFinish("1"); lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null); lessonPerson.setFinishDate(null);
} }
lessonPerson.setLearnProgress(newLearnProgress*100 + "%"); lessonPerson.setLearnProgress(newLearnProgress * 100 + "%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson); bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
studentChapter.setProgress(0); studentChapter.setProgress(0);
studentChapter.setCurrentLocation(0); studentChapter.setCurrentLocation(0);
...@@ -392,6 +394,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -392,6 +394,7 @@ public class BChapterServiceImpl implements BChapterService {
} }
} }
} }
}
//不是为添加章时插入资料表 //不是为添加章时插入资料表
if (StringUtils.isNotEmpty(model.getIsTest())) { if (StringUtils.isNotEmpty(model.getIsTest())) {
......
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