he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
8f3b4eff77

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -257,6 +257,45 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             subjectStudyRecordQueryBo.setGoodsId(goodsPeriodVo.getGoodsId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setGradeId(goodsPeriodVo.getGradeId());
+
+            //查询对应考试安排
+            List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsPeriodVo.getGoodsId());
+            if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
+                List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
+                List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
+                examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
+                    LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
+                    lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
+                    List<ExamApplyUser> examApplyUserList = iExamApplyUserService.list(lqw);
+                    if (examApplyUserList != null && examApplyUserList.size() > 0) {
+                        ArrayList<Long> userIds = new ArrayList<>();
+                        examApplyUserList.forEach(examApplyUser -> {
+                            userIds.add(examApplyUser.getUserId());
+                        });
+                        if (userIds.contains(bo.getUserId())) {
+                            examApplyGoodsVos.add(examApplyGoodsVo);
+                        }
+                    }else {
+                        examApplyGoodsVos2.add(examApplyGoodsVo);
+                    }
+                    LambdaQueryWrapper<ExamBeforeApply> lq = Wrappers.lambdaQuery();
+                    lq.eq(ExamBeforeApply::getApplyId, examApplyGoodsVo.getApplyId());
+                    ExamBeforeApply examBeforeApply = iExamBeforeApplyService.getOne(lq);
+                    if (examBeforeApply != null) {
+                        LambdaQueryWrapper<ExamBefore> lqw1 = Wrappers.lambdaQuery();
+                        lqw1.eq(ExamBefore::getBeforeId, examBeforeApply.getBeforeId());
+                        lqw1.eq(ExamBefore::getStatus, 1);
+                        ExamBefore examBefore = iExamBeforeService.getOne(lqw1);
+                        if (examBefore != null) {
+                            if (System.currentTimeMillis()/1000 > examBefore.getBeforeStartTime() && System.currentTimeMillis()/1000 < examBefore.getBeforeEndTime()) {
+                                goodsPeriodVo.setBeforeStatus(1L);
+                                goodsPeriodVo.setBeforeName(examBefore.getBeforeName());
+                            }
+                        }
+                    }
+                });
+                examApplyGoodsVos.addAll(examApplyGoodsVos2);
+            }
             //学时审核状态
        //     List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
             /*if (!CollectionUtils.isEmpty(subjectStudyRecordVos)) {