|
@@ -68,8 +68,6 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.security.KeyManagementException;
|
|
|
-import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
@@ -606,7 +604,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return respone;
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
- throw new CustomException("学时推送请求错误"+e.getMessage());
|
|
|
+ throw new CustomException("请求错误");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -740,7 +738,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return respone;
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
- throw new CustomException("请求错误"+e.getMessage());
|
|
|
+ throw new CustomException("请求错误");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1639,6 +1637,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
|
|
|
classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
|
|
|
Collections.sort(classPeriodVos);
|
|
|
+ Long startTotalTime = 0L;
|
|
|
+ Long endTotalTime = 0L;
|
|
|
for (ClassPeriodVo classPeriodVo : classPeriodVos) {
|
|
|
//为模块搜索下面的章 和节 并搜索学时记录
|
|
|
if (classPeriodVo.getType() == 1) {
|
|
@@ -1647,6 +1647,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam( bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
|
|
|
for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
|
|
|
if (classPeriodChapterVo.getType() == 2) {
|
|
|
+ Long ChapterEndTime = 0L;
|
|
|
+ Long ChapterStartTime = 0L;
|
|
|
List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
|
|
|
Collections.sort(classPeriodSectionVos);
|
|
|
classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
|
|
@@ -1667,18 +1669,31 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
- classPeriodSectionVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
|
|
|
+ List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
|
|
|
+ classPeriodSectionVo.setUserStudyRecordPhotoList(photoList);
|
|
|
classPeriodSectionVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStatus(userPeriodStatusVo.getStatus());
|
|
|
classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
- classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
+ classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
|
|
|
classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
|
|
|
classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
|
classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
|
|
|
classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
|
|
|
classPeriodSectionVo.setDurationTime(userPeriodStatusVo.getDurationTime());
|
|
|
+ if(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
|
|
|
+ ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
+ if(ChapterStartTime==0L||ChapterStartTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ ChapterStartTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
}
|
|
|
if(userPeriodStatusVos.size()>1){
|
|
|
// int preIndex = userPeriodStatusVos.size() - 2;
|
|
@@ -1712,12 +1727,24 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
|
|
|
classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
|
|
|
classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
|
|
|
classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
|
|
|
classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
|
classPeriodSectionVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
|
|
|
+ if(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
|
|
|
+ ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
+ if(ChapterStartTime==0L||ChapterStartTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ ChapterStartTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
}
|
|
|
classPeriodSectionVo.setModuleId(classPeriodVo.getId());
|
|
|
classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
|
|
@@ -1725,7 +1752,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setGradeId(bo.getGradeId());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ classPeriodChapterVo.setStudyEndTime(ChapterEndTime);
|
|
|
+ classPeriodChapterVo.setStudyStartTime(ChapterStartTime);
|
|
|
classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
|
|
|
}
|
|
|
else if (classPeriodChapterVo.getType() == 5) {
|
|
@@ -1755,6 +1783,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodChapterVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
|
|
|
classPeriodChapterVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
|
classPeriodChapterVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodChapterVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodChapterVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodChapterVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodChapterVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodChapterVo.getStudyEndTime();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1763,6 +1797,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
}
|
|
|
//为章搜索节记录和学时记录
|
|
|
if (classPeriodVo.getType() == 2) {
|
|
|
+ Long ChapterEndTime = 0L;
|
|
|
+ Long ChapterStartTime = 0L;
|
|
|
List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
|
|
|
Collections.sort(classPeriodSectionVos);
|
|
|
for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
|
|
@@ -1780,18 +1816,31 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
- classPeriodSectionVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
|
|
|
+ List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
|
|
|
+ classPeriodSectionVo.setUserStudyRecordPhotoList(photoList);
|
|
|
classPeriodSectionVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStatus(userPeriodStatusVo.getStatus());
|
|
|
classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
- classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
+ classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
|
|
|
classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
|
|
|
classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
|
classPeriodSectionVo.setAuditTime(userPeriodStatusVo.getAuditTime());
|
|
|
classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
|
|
|
classPeriodSectionVo.setDurationTime(userPeriodStatusVo.getDurationTime());
|
|
|
+ if(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
|
|
|
+ ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
+ if(ChapterStartTime==0L||ChapterStartTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ ChapterStartTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
}
|
|
|
if(userPeriodStatusVos.size()>1){
|
|
|
// int preIndex = userPeriodStatusVos.size() - 2;
|
|
@@ -1826,6 +1875,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
classPeriodSectionVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
|
|
|
classPeriodSectionVo.setPeriodId(userPeriodStatusVo.getPeriodId());
|
|
|
classPeriodSectionVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
@@ -1833,6 +1888,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
|
|
|
classPeriodSectionVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
|
|
|
classPeriodVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
|
|
|
+ if(Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime())&&ChapterEndTime.longValue()<classPeriodSectionVo.getStudyEndTime().longValue()){
|
|
|
+ ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
|
|
|
+ }
|
|
|
+ if(ChapterStartTime==0L||ChapterStartTime.longValue()>classPeriodSectionVo.getStudyStartTime().longValue()){
|
|
|
+ ChapterStartTime = classPeriodSectionVo.getStudyStartTime();
|
|
|
+ }
|
|
|
}
|
|
|
classPeriodSectionVo.setModuleId(0L);
|
|
|
classPeriodSectionVo.setChapterId(classPeriodVo.getId());
|
|
@@ -1841,6 +1902,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
}
|
|
|
classPeriodSectionVos.addAll(classPeriodSectionVos1);
|
|
|
classPeriodVo.setClassPeriodSectionList(classPeriodSectionVos);
|
|
|
+ classPeriodVo.setStudyEndTime(ChapterEndTime);
|
|
|
+ classPeriodVo.setStudyStartTime(ChapterStartTime);
|
|
|
}
|
|
|
|
|
|
//为节搜索学时记录
|
|
@@ -1859,12 +1922,22 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
- classPeriodVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
|
|
|
+
|
|
|
+ List<UserStudyRecordPhotoVo> photoList = entity2PhotoVo(userStudyRecordPhotoService.list(lqw));
|
|
|
+ classPeriodVo.setUserStudyRecordPhotoList(photoList);
|
|
|
classPeriodVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodVo.setStatus(userPeriodStatusVo.getStatus());
|
|
|
classPeriodVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
- classPeriodVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
+ if(photoList.size()>0){
|
|
|
+ classPeriodVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
+ }
|
|
|
+ if(startTotalTime==0L||startTotalTime.longValue()>classPeriodVo.getStudyStartTime().longValue()){
|
|
|
+ startTotalTime = classPeriodVo.getStudyStartTime();
|
|
|
+ }
|
|
|
+ if(endTotalTime==0L||(Validator.isNotEmpty(classPeriodVo.getStudyEndTime())&&endTotalTime.longValue()<classPeriodVo.getStudyEndTime().longValue())){
|
|
|
+ endTotalTime = classPeriodVo.getStudyEndTime();
|
|
|
+ }
|
|
|
classPeriodVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
|
|
|
classPeriodVo.setPeriodId(userPeriodStatusVo.getPeriodId());
|
|
|
classPeriodVo.setPeriodStatusId(userPeriodStatusVo.getId());
|
|
@@ -1885,6 +1958,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ if(classPeriodVos.size()>0){
|
|
|
+ classPeriodVos.get(0).setStartTotalTime(startTotalTime);
|
|
|
+ classPeriodVos.get(0).setEndTotalTime(endTotalTime);
|
|
|
+ }
|
|
|
return classPeriodVos;
|
|
|
}
|
|
|
|