Explorar o código

2022-10-24 课程列表,学习记录,代码添加空校验

chaiyunlong %!s(int64=3) %!d(string=hai) anos
pai
achega
25a2a95701

+ 2 - 1
zd-modules/zd-exam/src/main/java/com/zd/exam/service/impl/ElChapterLearnRecordServiceImpl.java

@@ -6,6 +6,7 @@ import com.zd.common.core.security.TokenService;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SaveUtil;
 import com.zd.common.core.utils.SecurityUtils;
+import com.zd.common.core.utils.StringUtils;
 import com.zd.exam.domain.ElChapterLearnRecord;
 import com.zd.exam.domain.ElConvertRecord;
 import com.zd.exam.domain.ElCourseChapter;
@@ -259,7 +260,7 @@ public class ElChapterLearnRecordServiceImpl implements IElChapterLearnRecordSer
                             learnStatus = 0;
                             break;
                         }else if(chapter.getLearnStatus() == 1) {
-                            if(chapter.getIsAssess() == 1 && chapter.getAssessStatus() == 0){
+                            if(StringUtils.isNotNull(chapter.getIsAssess()) && chapter.getIsAssess() == 1 && chapter.getAssessStatus() == 0){
                                 learnStatus = 3;
                             }
                         }else {

+ 1 - 1
zd-modules/zd-exam/src/main/java/com/zd/exam/service/impl/ElCourseServiceImpl.java

@@ -275,7 +275,7 @@ public class ElCourseServiceImpl implements IElCourseService {
                         learnStatus = 0;
                         break;
                     }else if(chapter.getLearnStatus() == 1) {
-                        if(chapter.getIsAssess() == 1 && chapter.getAssessStatus() == 0){
+                        if(StringUtils.isNotNull(chapter.getIsAssess()) && chapter.getIsAssess() == 1 && chapter.getAssessStatus() == 0){
                             learnStatus = 3;
                         }
                     }else {