|
|
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.Page;
|
|
|
@@ -26,6 +27,12 @@ import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.file.FileUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.alioss.service.OssService;
|
|
|
+import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
|
|
|
+import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
|
|
|
+import com.zhongzheng.modules.bank.vo.ExamVo;
|
|
|
+import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
|
|
|
import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
|
|
|
@@ -35,8 +42,11 @@ import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseModuleVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGrade;
|
|
|
@@ -58,17 +68,11 @@ import com.zhongzheng.modules.system.domain.SysOldOrg;
|
|
|
import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
|
import com.zhongzheng.modules.system.service.ISysOldOrgService;
|
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
-import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
|
|
|
-import com.zhongzheng.modules.user.bo.UserBankRecordQueryBo;
|
|
|
-import com.zhongzheng.modules.user.bo.UserQueryBo;
|
|
|
-import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
|
|
|
+import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordPhotoMapper;
|
|
|
-import com.zhongzheng.modules.user.service.IUserBankRecordService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
+import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -82,6 +86,13 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.ZonedDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
@@ -165,6 +176,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserExamRecordService iUserExamRecordService;
|
|
|
+
|
|
|
@Value("${aliyun.oss.endpoint}")
|
|
|
private String ALIYUN_OSS_ENDPOINT;
|
|
|
|
|
|
@@ -201,6 +215,15 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Autowired
|
|
|
private IMajorService iMajorService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGoodsAttachedService iGoodsAttachedService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IQuestionModuleChapterService iQuestionModuleChapterService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IQuestionChapterExamService iQuestionChapterExamService;
|
|
|
+
|
|
|
|
|
|
private String SEVEN_OFFICIALPUSH_INFOACCOUNT;
|
|
|
private String SEVEN_OFFICIALPUSH_TOKEN;
|
|
|
@@ -1686,6 +1709,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
private UserPeriodExportV2Vo mergeEamDataV2(Long index, String moduleName, String chapterName, String sectionName, ClassPeriodSectionVo classPeriodSectionVo) {
|
|
|
//试卷学习记录
|
|
|
UserBankRecordQueryBo recordQueryBo = BeanUtil.toBean(classPeriodSectionVo, UserBankRecordQueryBo.class);
|
|
|
+ recordQueryBo.setCurrentStatus(1);
|
|
|
List<UserBankRecordVo> recordList = iUserBankRecordService.queryList(recordQueryBo);
|
|
|
//录入学时记录
|
|
|
UserPeriodExportV2Vo userPeriodExportVo = new UserPeriodExportV2Vo();
|
|
|
@@ -1707,6 +1731,31 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return userPeriodExportVo;
|
|
|
}
|
|
|
|
|
|
+ private UserPeriodExportV2Vo mergeQuestionEamDataV2(Long index, String moduleName, String chapterName, String examName, UserExamRecordQueryBo recordQueryBo) {
|
|
|
+ //试卷学习记录
|
|
|
+ List<UserExamRecordVo> recordList = iUserExamRecordService.queryList(recordQueryBo);
|
|
|
+ //录入学时记录
|
|
|
+ UserPeriodExportV2Vo userPeriodExportVo = new UserPeriodExportV2Vo();
|
|
|
+ userPeriodExportVo.setId(index);
|
|
|
+ userPeriodExportVo.setExamName(examName);
|
|
|
+ userPeriodExportVo.setModuleName(moduleName);
|
|
|
+ userPeriodExportVo.setChapterName(chapterName);
|
|
|
+ List<UserPeriodItemExportVo> studyList = new ArrayList<>();
|
|
|
+ for (UserExamRecordVo vo : recordList) {
|
|
|
+ UserPeriodItemExportVo exportVo = new UserPeriodItemExportVo();
|
|
|
+ exportVo.setStudyStartTime(vo.getCreateTime());
|
|
|
+ exportVo.setStudyEndTime(vo.getCommitTime());
|
|
|
+ exportVo.setSectionType(4);
|
|
|
+ exportVo.setStatus(vo.getReportStatus());
|
|
|
+ exportVo.setScore(vo.getPerformance());
|
|
|
+ exportVo.setFromPlat(vo.getFromPlat());
|
|
|
+ exportVo.setScore(vo.getPerformance());
|
|
|
+ studyList.add(exportVo);
|
|
|
+ }
|
|
|
+ userPeriodExportVo.setRecordList(studyList);
|
|
|
+ return userPeriodExportVo;
|
|
|
+ }
|
|
|
+
|
|
|
private UserPeriodExportV2Vo mergeDataV2(Long index, String moduleName, String chapterName, String sectionName, ClassPeriodSectionVo classPeriodSectionVo, UserStudyRecordQueryBo recordQueryBo) {
|
|
|
//节学习记录
|
|
|
List<SectionStudyRecordVo> recordList = iUserStudyRecordService.selectSectionRecord(recordQueryBo);
|
|
|
@@ -1732,6 +1781,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
exportVo.setDurationTime(classPeriodSectionVo.getDurationTime());
|
|
|
exportVo.setSectionType(classPeriodSectionVo.getSectionType());
|
|
|
exportVo.setFromPlat(vo.getFromPlat());
|
|
|
+ exportVo.setSectionType(vo.getSectionType());
|
|
|
studyList.add(exportVo);
|
|
|
}
|
|
|
endTime = vo.getEndTime();
|
|
|
@@ -1747,9 +1797,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
if (classPeriodSectionVo.getSectionType() == 2 || classPeriodSectionVo.getSectionType() == 3) {
|
|
|
//默认加上直播
|
|
|
UserPeriodItemExportVo exportVo = new UserPeriodItemExportVo();
|
|
|
- exportVo.setSectionType(2);
|
|
|
exportVo.setStatus(0); //直播未参与
|
|
|
exportVo.setDurationTime(classPeriodSectionVo.getRealDuration());
|
|
|
+ exportVo.setSectionType(classPeriodSectionVo.getSectionType());
|
|
|
studyList.add(exportVo);
|
|
|
Long startTime = null;
|
|
|
Long endTime = null;
|
|
|
@@ -1770,7 +1820,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
exportItemVo.setStudyStartTime(startTime);
|
|
|
exportItemVo.setStatus(0);
|
|
|
exportItemVo.setDurationTime(classPeriodSectionVo.getDurationTime());
|
|
|
- exportVo.setSectionType(3);
|
|
|
+ exportItemVo.setSectionType(3);
|
|
|
+ exportItemVo.setFromPlat(vo.getFromPlat());
|
|
|
+ exportItemVo.setVideoCurrentTime(vo.getVideoCurrentTime());
|
|
|
studyList.add(exportItemVo);
|
|
|
}
|
|
|
endTime = vo.getEndTime();
|
|
|
@@ -2857,6 +2909,83 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return studyList;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<UserPeriodExportV2Vo> listUserStudyQuestionRecordV2Week(ClassGradeUserQueryBo bo) {
|
|
|
+ if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
+ throw new CustomException("orderGoodsId缺失");
|
|
|
+ }
|
|
|
+ GoodsAttachedQueryBo attachedQueryBo = new GoodsAttachedQueryBo();
|
|
|
+ attachedQueryBo.setGoodsId(bo.getGoodsId());
|
|
|
+ List<GoodsAttachedVo> topList = iGoodsAttachedService.getTopList(attachedQueryBo);
|
|
|
+ String moduleName = "";
|
|
|
+ String chapterName = "";
|
|
|
+ String examName = "";
|
|
|
+ List<UserPeriodExportV2Vo> studyList = new ArrayList<>();
|
|
|
+ long i = 0;
|
|
|
+ Long gradeId = bo.getGradeId();
|
|
|
+ Long userId = bo.getUserId();
|
|
|
+ Long goodsId = bo.getGoodsId();
|
|
|
+ Long courseId = bo.getCourseId();
|
|
|
+ Long orderGoodsId = bo.getOrderGoodsId();
|
|
|
+ for (GoodsAttachedVo classPeriodVo : topList) {
|
|
|
+ moduleName = "";
|
|
|
+ chapterName = "";
|
|
|
+ examName = "";
|
|
|
+ if (classPeriodVo.getType() == 1) {
|
|
|
+ moduleName = classPeriodVo.getName();
|
|
|
+ QuestionModuleChapterQueryBo moduleChapterQueryBo = new QuestionModuleChapterQueryBo();
|
|
|
+ moduleChapterQueryBo.setModuleExamId(classPeriodVo.getMajorId());
|
|
|
+ List<QuestionChapterVo> chapterList= iQuestionModuleChapterService.getList(moduleChapterQueryBo);
|
|
|
+ for (QuestionChapterVo chapterVo : chapterList) {
|
|
|
+ chapterName = chapterVo.getName();
|
|
|
+ QuestionChapterExamQueryBo chapterExamQueryBo = new QuestionChapterExamQueryBo();
|
|
|
+ chapterExamQueryBo.setChapterExamId(chapterVo.getChapterExamId());
|
|
|
+ List<ExamVo> examVoList = iQuestionChapterExamService.getSimpleList(chapterExamQueryBo);
|
|
|
+ for (ExamVo examVo : examVoList) {
|
|
|
+ examName = examVo.getExamName();
|
|
|
+ i++;
|
|
|
+ UserExamRecordQueryBo recordQueryBo = new UserExamRecordQueryBo();
|
|
|
+ recordQueryBo.setExamId(examVo.getExamId());
|
|
|
+ recordQueryBo.setModuleExamId(classPeriodVo.getMajorId());
|
|
|
+ recordQueryBo.setChapterExamId(chapterVo.getChapterExamId());
|
|
|
+ recordQueryBo.setUserId(userId);
|
|
|
+ recordQueryBo.setOrderGoodsId(orderGoodsId);
|
|
|
+ studyList.add(mergeQuestionEamDataV2(i, moduleName, chapterName, examName, recordQueryBo));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (classPeriodVo.getType() == 2) {
|
|
|
+ chapterName = classPeriodVo.getName();
|
|
|
+ QuestionChapterExamQueryBo chapterExamQueryBo = new QuestionChapterExamQueryBo();
|
|
|
+ chapterExamQueryBo.setChapterExamId(classPeriodVo.getMajorId());
|
|
|
+ List<ExamVo> examVoList = iQuestionChapterExamService.getSimpleList(chapterExamQueryBo);
|
|
|
+ for (ExamVo examVo : examVoList) {
|
|
|
+ examName = examVo.getExamName();
|
|
|
+ i++;
|
|
|
+ UserExamRecordQueryBo recordQueryBo = new UserExamRecordQueryBo();
|
|
|
+ recordQueryBo.setExamId(examVo.getExamId());
|
|
|
+ recordQueryBo.setModuleExamId(0L);
|
|
|
+ recordQueryBo.setChapterExamId(classPeriodVo.getMajorId());
|
|
|
+ recordQueryBo.setUserId(userId);
|
|
|
+ recordQueryBo.setOrderGoodsId(orderGoodsId);
|
|
|
+ studyList.add(mergeQuestionEamDataV2(i, moduleName, chapterName, examName, recordQueryBo));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ examName = classPeriodVo.getName();
|
|
|
+ i++;
|
|
|
+ UserExamRecordQueryBo recordQueryBo = new UserExamRecordQueryBo();
|
|
|
+ recordQueryBo.setExamId(classPeriodVo.getMajorId());
|
|
|
+ recordQueryBo.setModuleExamId(0L);
|
|
|
+ recordQueryBo.setChapterExamId(0L);
|
|
|
+ recordQueryBo.setUserId(userId);
|
|
|
+ recordQueryBo.setOrderGoodsId(orderGoodsId);
|
|
|
+ studyList.add(mergeQuestionEamDataV2(i, moduleName, chapterName, examName, recordQueryBo));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return studyList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo) {
|
|
|
if(Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
@@ -3638,6 +3767,58 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return this.baseMapper.listBKUserPeriod(bo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<UserUsbRecordVo> getListUserSubscribe(UserUsbRecordBo bo) {
|
|
|
+ if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() == 6){
|
|
|
+ //根据月份筛选
|
|
|
+ String dateStr = String.format(bo.getApplyDateTime()); // 指定年月
|
|
|
+ LocalDate date = LocalDate.parse(dateStr + "01", DateTimeFormatter.BASIC_ISO_DATE);
|
|
|
+ LocalDate dateFirst = date.with(TemporalAdjusters.firstDayOfMonth()); // 指定年月的第一天
|
|
|
+ LocalDate dateEnd = date.with(TemporalAdjusters.lastDayOfMonth()); // 指定年月的最后一天
|
|
|
+ ZonedDateTime zonedDateTime1 = dateFirst.atStartOfDay(ZoneId.systemDefault());
|
|
|
+ Date date1 = Date.from(zonedDateTime1.toInstant());
|
|
|
+ ZonedDateTime zonedDateTime = dateEnd.atStartOfDay(ZoneId.systemDefault());
|
|
|
+ Date date2 = Date.from(zonedDateTime.toInstant());
|
|
|
+ Long startTime = date1.getTime()/1000;
|
|
|
+ Long endTime = (date2.getTime()/1000) + 86400;
|
|
|
+ bo.setMonthStartTime(startTime);
|
|
|
+ bo.setMonthEndTime(endTime);
|
|
|
+ }else if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() > 6){
|
|
|
+ //根据某天筛选
|
|
|
+ String dateStr = String.format(bo.getApplyDateTime());
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
+ try {
|
|
|
+ Date parse = sdf.parse(dateStr);
|
|
|
+ bo.setMonthStartTime(parse.getTime()/1000);
|
|
|
+ bo.setMonthEndTime(parse.getTime()/1000);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<UserUsbRecordVo> usbRecordVos = baseMapper.getListUserSubscribe(bo);
|
|
|
+ if (CollectionUtils.isEmpty(usbRecordVos)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ usbRecordVos.forEach(item -> {
|
|
|
+ if (ObjectUtils.isNotNull(item.getApplyTime())){
|
|
|
+ item.setApplyTimeStr(String.format("%s (%s-%s)",DateUtils.timestampToDateFormat(item.getApplyTime(),"yyyy-MM-dd")
|
|
|
+ ,item.getApplyStarTime(),item.getApplyEndTime()));
|
|
|
+ }
|
|
|
+ if (item.getSubscribeStatus() == 1){
|
|
|
+ if (ObjectUtils.isNull(item.getApplyTime())){
|
|
|
+ item.setSubscribeStatus(3);
|
|
|
+ }else {
|
|
|
+ Long aLong = DateUtils.dateTimeSec("HH:mm", item.getApplyEndTime());
|
|
|
+ Long time = item.getApplyTime()+aLong;
|
|
|
+ if (DateUtils.getNowTime() > time){
|
|
|
+ item.setSubscribeStatus(3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return usbRecordVos;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|