he2802 2 years ago
parent
commit
f8c6107b31

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodQueryBo.java

@@ -88,4 +88,5 @@ public class UserPeriodQueryBo extends BaseEntity {
 
 	@ApiModelProperty("周查询结束时间")
 	private Long searchWeekEndTime;
+	private Long orderGoodsId;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -42,7 +42,7 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     ClassPeriodStudentVo userPeriodStatus(ClassGradeUserQueryBo bo);
 
-    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("gradeId") Long gradeId);
+    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
     List<ClassPeriodSectionVo> listPeriodSection(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 

+ 59 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1371,6 +1371,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
                 subjectStudyRecordQueryBo.setUserId(classPeriodStudentVo.getUserId());
                 subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
+                subjectStudyRecordQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                 User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getUserId, classPeriodStudentVo.getUserId()));
                 if (Validator.isNotEmpty(user.getOneInchPhotos())) {
                     classPeriodStudentVo.setOneInchPhotos(ALIYUN_OSS_ENDPOINT + "/" + user.getOneInchPhotos());
@@ -1392,6 +1393,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 ClassGradeUserQueryBo classGradeUserQueryBo1 = new ClassGradeUserQueryBo();
                 classGradeUserQueryBo1.setUserId(classPeriodStudentVo.getUserId());
                 classGradeUserQueryBo1.setGradeId(classPeriodStudentVo.getGradeId());
+                classGradeUserQueryBo1.setOrderGoodsId(classPeriodStudentVo.getOrderGoodsId());
                 classGradeUserQueryBo1.setGoodsId(classPeriodStudentVo.getGoodsId());
                 classGradeUserQueryBo1.setSearchWeekStartTime(weekDataVo.getSearchWeekStartTime());
                 classGradeUserQueryBo1.setSearchWeekEndTime(weekDataVo.getSearchWeekEndTime());
@@ -1916,6 +1918,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<UserPeriodExportVo> listUserStudyRecord(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺失OrderGoodsId");
+        }
         //学习记录
         ClassGradeUserQueryBo cGQB = new ClassGradeUserQueryBo();
         cGQB.setGoodsId(bo.getGoodsId());
@@ -1930,11 +1935,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : list) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2132,6 +2138,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         cGQB.setGoodsId(bo.getGoodsId());
         cGQB.setUserId(bo.getUserId());
         cGQB.setGradeId(bo.getGradeId());
+        cGQB.setOrderGoodsId(bo.getOrderGoodsId());
         List<ClassPeriodVo> list = listPeriodAudit(cGQB);
         String moduleName = "";
         String chapterName = "";
@@ -2141,11 +2148,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : list) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2163,6 +2171,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(gradeId);
+                                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -2185,6 +2194,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
                                 }
@@ -2199,6 +2209,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(gradeId);
+                                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -2221,6 +2232,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, classPeriodChapterVo.getPerformance(), true));
                                 }
@@ -2245,6 +2257,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(gradeId);
+                    userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                     userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -2267,6 +2280,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
                     }
@@ -2284,6 +2298,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                     userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -2306,6 +2321,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, classPeriodVo.getPerformance(), true));
                     }
@@ -2325,6 +2341,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -2347,6 +2364,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodVo.setChapterId(0L);
                 classPeriodVo.setGoodsId(bo.getGoodsId());
                 classPeriodVo.setGradeId(bo.getGradeId());
+                classPeriodVo.setOrderGoodsId(bo.getOrderGoodsId());
                 ClassPeriodSectionVo classPeriodSectionVo = BeanUtil.toBean(classPeriodVo, ClassPeriodSectionVo.class);
                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
@@ -2364,6 +2382,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
      */
     @Override
     public List<UserPeriodExportV2Vo> listUserStudyRecordV2(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺失OrderGoodsId");
+        }
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2376,12 +2397,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         Long courseId = bo.getCourseId();
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2400,6 +2422,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 recordQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 recordQueryBo.setModuleId(classPeriodVo.getId());
                                 recordQueryBo.setGradeId(gradeId);
+                                recordQueryBo.setOrderGoodsId(orderGoodsId);
                                 studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
                             } else {
                                 //章卷
@@ -2408,6 +2431,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                                 studyList.add(mergeEamDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo));
                             }
@@ -2431,6 +2455,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setChapterId(classPeriodVo.getId());
                     recordQueryBo.setModuleId(classPeriodVo.getId());
                     recordQueryBo.setGradeId(gradeId);
+                    recordQueryBo.setOrderGoodsId(orderGoodsId);
                     studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
                 }
                 List<ClassPeriodSectionVo> classPeriodSectionVos1 = baseMapper.listPeriodSectionExam(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId);
@@ -2443,6 +2468,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                     studyList.add(mergeEamDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo));
                 }
@@ -2460,6 +2486,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setUserId(classPeriodVo.getUserId());
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
                 UserStudyRecordQueryBo recordQueryBo = BeanUtil.toBean(userPeriodQueryBo, UserStudyRecordQueryBo.class);
 
@@ -2479,6 +2506,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<UserPeriodExportV2Vo> listUserStudyRecordV2Week(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("orderGoodsId缺失");
+        }
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2492,11 +2522,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
         Long courseId = bo.getCourseId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2518,6 +2549,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 recordQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 recordQueryBo.setModuleId(classPeriodVo.getId());
                                 recordQueryBo.setGradeId(gradeId);
+                                recordQueryBo.setOrderGoodsId(orderGoodsId);
                                 recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
@@ -2528,6 +2560,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                                 classPeriodSectionVo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 classPeriodSectionVo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2553,6 +2586,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setChapterId(classPeriodVo.getId());
                     recordQueryBo.setModuleId(classPeriodVo.getId());
                     recordQueryBo.setGradeId(gradeId);
+                    recordQueryBo.setOrderGoodsId(orderGoodsId);
                     recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
@@ -2567,6 +2601,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                     classPeriodSectionVo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     classPeriodSectionVo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2587,6 +2622,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 UserStudyRecordQueryBo recordQueryBo = BeanUtil.toBean(userPeriodQueryBo, UserStudyRecordQueryBo.class);
                 recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                 recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2607,6 +2643,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺少OrderGoodsId");
+        }
         //班级学员信息
         List<ClassPeriodUserVo> classPeriodUserVos = baseMapper.listPeriod(bo);
         for (ClassPeriodUserVo classPeriodUserVo : classPeriodUserVos) {
@@ -2655,6 +2694,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺少OrderGoodsId");
+        }
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2665,7 +2707,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId());
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
                 Collections.sort(classPeriodChapterVos);
                 classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam(bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
@@ -2687,6 +2729,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     int numIndex = userPeriodStatusVos.size() - 1;
@@ -2732,6 +2775,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                                 classPeriodSectionVo.setGradeId(bo.getGradeId());
+                                classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                             } else {
                                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
                                 userPeriodQueryBo.setExamId(classPeriodSectionVo.getId());
@@ -2741,6 +2785,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                                 userPeriodQueryBo.setType(2);
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
@@ -2777,6 +2822,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                                 classPeriodSectionVo.setGradeId(bo.getGradeId());
+                                classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                             }
                         }
                         classPeriodChapterVo.setStudyEndTime(ChapterEndTime);
@@ -2790,6 +2836,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         userPeriodQueryBo.setUserId(classPeriodChapterVo.getUserId());
                         userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                         userPeriodQueryBo.setGradeId(bo.getGradeId());
+                        userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                         userPeriodQueryBo.setType(3);
                         List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                         if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
@@ -2837,6 +2884,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         int numIndex = userPeriodStatusVos.size() - 1;
@@ -2882,6 +2930,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                     classPeriodSectionVo.setGradeId(bo.getGradeId());
+                    classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                 }
                 List<ClassPeriodSectionVo> classPeriodSectionVos1 = baseMapper.listPeriodSectionExam(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos1) {
@@ -2893,6 +2942,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         int numIndex = userPeriodStatusVos.size() - 1;
@@ -2929,6 +2979,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                     classPeriodSectionVo.setGradeId(bo.getGradeId());
+                    classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                 }
                 classPeriodSectionVos.addAll(classPeriodSectionVos1);
                 classPeriodVo.setClassPeriodSectionList(classPeriodSectionVos);
@@ -2947,6 +2998,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                     int numIndex = userPeriodStatusVos.size() - 1;
@@ -2986,6 +3038,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodVo.setChapterId(0L);
                 classPeriodVo.setGoodsId(bo.getGoodsId());
                 classPeriodVo.setGradeId(bo.getGradeId());
+                classPeriodVo.setOrderGoodsId(bo.getOrderGoodsId());
             }
 
         }
@@ -3007,7 +3060,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodChapterVo> listPeriodAuditChapter(ClassGradeUserQueryBo bo) {
-        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(), bo.getCourseId(), bo.getUserId(), bo.getGradeId());
+        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(), bo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
         return classPeriodChapterVos;
     }
 

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -139,6 +139,10 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	@ApiModelProperty("模塊ID")
 	private Long moduleId;
 
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
+
+
 	@Override
 	public int compareTo(ClassPeriodChapterVo o) {
 		return this.getSort() - o.getSort();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -182,6 +182,8 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 
 	@ApiModelProperty("周查询结束时间")
 	private Long searchWeekEndTime;
+
+	private Long orderGoodsId;
 	@Override
 	public int compareTo(ClassPeriodSectionVo o) {
 		return this.getSort() - o.getSort();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -215,6 +215,8 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	@Excel(name = "做卷类型  1测试 2考试")
 	@ApiModelProperty("做题类型  1测试 2考试")
 	private Integer doType;
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
 	@Override
 	public int compareTo(ClassPeriodVo o) {
 		if(o.getCourseSort()==this.getCourseSort()){

+ 20 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -131,6 +131,7 @@
         <result property="recordStartTime" column="record_start_time"/>
         <result property="recordEndTime" column="record_end_time"/>
         <result property="onLineTime" column="on_line_time"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
@@ -184,6 +185,7 @@
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realDuration" column="real_duration"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
@@ -202,6 +204,7 @@
         <result property="sort" column="sort"/>
         <result property="doType" column="do_type"/>
         <result property="moduleId" column="module_id"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
@@ -395,6 +398,7 @@
         cgu.period_plush,
         cgu.period_status_num,
         cgu.period_time,
+        cgu.order_goods_id,
         IFNULL(ge.exam_num,0) as exam_num,
         <if test="userPhoto != null and userPhoto == 1">
             up.key_value,
@@ -564,6 +568,7 @@
         cgu.period_plush,
         cgu.period_status_num,
         cgu.period_time,
+        cgu.order_goods_id,
         <if test="userPhoto != null and userPhoto == 1">
             up.key_value,
         </if>
@@ -687,6 +692,7 @@
         cg.class_name,
         cgu.period_plush,
         cgu.period_status_num,
+        cgu.order_goods_id,
         (SELECT og.service_start_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
         (SELECT og.service_end_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
         <if test="userPhoto != null and userPhoto == 1">
@@ -888,6 +894,7 @@
         (SELECT u.user_id FROM `user` u where 1=1     <if test="userId != null and userId !='' ">
         and u.user_id = #{userId}
     </if>) as user_id,
+        0 as common_sign,
         (SELECT cm.module_name FROM course_module cm where cm.menu_id = cm.module_id) as type_name,
         (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs LEFT JOIN course_module_chapter cmc on
         cmc.chapter_id=ccs.chapter_id where cmc.module_id=cm.menu_id) as class_hours,
@@ -918,13 +925,14 @@
         and u.user_id = #{userId}
     </if>) as user_id,
         (SELECT cc.`name` FROM course_chapter cc where cm.menu_id = cc.chapter_id) as type_name,
+        (SELECT cc.common_sign FROM course_chapter cc where cm.menu_id = cc.chapter_id) as common_sign,
         (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs where ccs.chapter_id=cm.menu_id) as class_hours,
         2 as type,
         (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time ASC
+        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time ASC
         limit 1) as study_start_time,
         (SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time DESC
+        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time DESC
         limit 1) as study_end_time
         FROM
         course_menu cm
@@ -1087,6 +1095,7 @@
         SELECT
         cmc.sort,
         cc.chapter_id as id,
+        cc.common_sign,
         cm.course_id,
         ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
         and u.user_id = #{userId}
@@ -1122,6 +1131,9 @@
         <if test="userId != null and userId !='' ">
             AND usr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND usr.order_goods_id=#{orderGoodsId}
+        </if>
         ORDER BY
         usr.create_time ASC
         LIMIT 1
@@ -1150,6 +1162,9 @@
         <if test="userId != null and userId !='' ">
             AND usr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND usr.order_goods_id=#{orderGoodsId}
+        </if>
         ORDER BY
         usr.create_time DESC
         LIMIT 1
@@ -1178,6 +1193,9 @@
         <if test="userId != null and userId !='' ">
             AND ubr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND ubr.order_goods_id=#{orderGoodsId}
+        </if>
         AND cme.chapter_id = cmc.chapter_id
         LIMIT 1 ) AS performance
         FROM

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

@@ -68,7 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="moduleId != null ">
             and up.module_id = #{moduleId}
         </if>
-
+        <if test="orderGoodsId != null ">
+            and (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is NULL )
+        </if>
         <if test="chapterId != null">
             and up.chapter_id = #{chapterId}
         </if>