mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 18:06:50 +08:00
完成情况检查
This commit is contained in:
@@ -30,14 +30,19 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
* @param total
|
||||
*/
|
||||
public void finishCheck(String studyId,String courseId,Integer total){
|
||||
log.info("------1.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + 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);
|
||||
log.info("------2.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||
if (total == 0){
|
||||
total=courseContentDao.count(FieldFilters.eq("courseId", courseId),FieldFilters.eq("deleted",false));
|
||||
}
|
||||
}
|
||||
|
||||
log.info("------3.完成情况检查---------------studyId = " + studyId + " , courseId = " + courseId + " , total = " + total );
|
||||
//以下注意,float类型,是否等于100对应
|
||||
float percent=n*100/total;
|
||||
if(n>=total) {
|
||||
|
||||
Reference in New Issue
Block a user