he2802 há 1 ano atrás
pai
commit
2a23b72a5b

+ 8 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -4529,8 +4529,14 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     item.setChapterExamName(v2Vo.getChapterName());
                     item.setExamName(v2Vo.getExamName());
                     item.setStudyTimeTxt(DateUtils.timestampToDateFormat(itemExportVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(itemExportVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
-                    long second = itemExportVo.getStudyEndTime().longValue() - itemExportVo.getStudyStartTime().longValue();
-                    item.setStudyTimeLongTxt(DateUtils.secToTime((int) second));
+                    if(Validator.isNotEmpty(itemExportVo.getStudyEndTime())){
+                        long second = itemExportVo.getStudyEndTime().longValue() - itemExportVo.getStudyStartTime().longValue();
+                        item.setStudyTimeLongTxt(DateUtils.secToTime((int) second));
+                    }else{
+                        long second = DateUtils.getNowTime().longValue() - itemExportVo.getStudyStartTime().longValue();
+                        item.setStudyTimeLongTxt(DateUtils.secToTime((int) second));
+                    }
+
                     item.setScore(itemExportVo.getScore());
                     if(Validator.isNotEmpty(itemExportVo.getRightRate())){
                         item.setRate(itemExportVo.getRightRate()+"");