mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
调试修复课程状态
This commit is contained in:
@@ -41,22 +41,53 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
//以下注意,float类型,是否等于100对应
|
||||
float percent=n*100/total;
|
||||
if(n>=total) {
|
||||
log.info(" 100进度 CourseId = " + courseId + " , StudyId = " + studyId + " , total = " + total + ",已完成 = " + n);
|
||||
//自主报名的课程,代表学习完成
|
||||
super.updateMultiFieldById(studyId,
|
||||
UpdateBuilder.create("progress",100f),
|
||||
UpdateBuilder.create("lastTime",now),
|
||||
UpdateBuilder.create("finishTime",now),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
||||
}else {
|
||||
super.updateMultiFieldById(studyId,
|
||||
UpdateBuilder.create("progress",percent),
|
||||
UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
||||
}
|
||||
}
|
||||
|
||||
public void finishCheck1(String studyId,String courseId,Integer total){
|
||||
LocalDateTime now=LocalDateTime.now();
|
||||
//已完成的内容
|
||||
int n=scItemDao.count(FieldFilters.eq("studyId",studyId),FieldFilters.eq("status",StudyCourseItem.STATUS_FINISH));
|
||||
if(total==null) {
|
||||
// total=courseContentDao.count(FieldFilters.eq("courseId", courseId),FieldFilters.eq("deleted",false));
|
||||
total = courseContentDao.getCount(courseId);
|
||||
}
|
||||
if (total != 0){
|
||||
|
||||
//以下注意,float类型,是否等于100对应
|
||||
float percent=n*100/total;
|
||||
if(n>=total) {
|
||||
log.info(" 100进度 CourseId = " + courseId + " , StudyId = " + studyId + " , total = " + total + ",已完成 = " + n);
|
||||
//自主报名的课程,代表学习完成
|
||||
// super.updateMultiFieldById(studyId,
|
||||
// UpdateBuilder.create("progress",100f),
|
||||
// UpdateBuilder.create("lastTime",now),
|
||||
// UpdateBuilder.create("finishTime",now),
|
||||
// UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
||||
}else {
|
||||
log.info("进度=" + percent + " ,CourseId = " + courseId + " , StudyId = " + studyId + " , total = " + total + ",已完成 = " + n);
|
||||
}else {
|
||||
log.info("进度=" + percent + " ,CourseId = " + courseId + " , StudyId = " + studyId + " , total = " + total + ",已完成 = " + n);
|
||||
// super.updateMultiFieldById(studyId,
|
||||
// UpdateBuilder.create("progress",percent),
|
||||
// UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
||||
// UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
||||
}
|
||||
|
||||
}else {
|
||||
log.info("----------分母等于0-------total = " + total);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅仅是更新学习进度,不做其它的处理
|
||||
* @param studyId
|
||||
|
||||
@@ -136,8 +136,8 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
||||
log.info("-----------------CourseId = " + item.getCourseId() + " , StudyId = " + item.getStudyId() + " , StudentId = " + item.getStudentId());
|
||||
int totalContent = courseContentDao.getCount(item.getCourseId());
|
||||
log.info("----------准备判断进度-------totalContent = " + totalContent);
|
||||
scDao.finishCheck(item.getStudyId(),item.getCourseId(),totalContent);
|
||||
log.info("------判断进度完毕----------------------");
|
||||
scDao.finishCheck1(item.getStudyId(),item.getCourseId(),totalContent);
|
||||
log.info("----------判断进度完毕----------------------");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user