浏览代码

fix 考培

he2802 3 年之前
父节点
当前提交
02f2dfaea0

+ 17 - 18
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -473,24 +473,23 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                 });
                 examApplyGoodsVos.addAll(examApplyGoodsVos2);
                 goodsUserVo.setExamApplyGoodsList(examApplyGoodsVos);
-
-                LambdaQueryWrapper<UserSubscribe> lq = Wrappers.lambdaQuery();
-                lq.eq(UserSubscribe::getOrderGoodsId, goodsUserVo.getOrderGoodsId());
-                lq.eq(UserSubscribe::getSubscribeStatus, 1);
-                lq.eq(UserSubscribe::getBeforeStatus, 1);
-                UserSubscribe userSubscribe = iUserSubscribeService.getOne(lq);
-                if (userSubscribe != null) {
-                    LambdaQueryWrapper<ExamBefore> lqw1 = Wrappers.lambdaQuery();
-                    lqw1.eq(ExamBefore::getBeforeId, userSubscribe.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()) {
-                            goodsUserVo.setBeforeStatus(1L);
-                            goodsUserVo.setBeforeName(examBefore.getBeforeName());
-                            goodsUserVo.setBeforeStartTime(examBefore.getBeforeStartTime());
-                            goodsUserVo.setBeforeEndTime(examBefore.getBeforeEndTime());
-                        }
+            }
+            LambdaQueryWrapper<UserSubscribe> lq = Wrappers.lambdaQuery();
+            lq.eq(UserSubscribe::getOrderGoodsId, goodsUserVo.getOrderGoodsId());
+            lq.eq(UserSubscribe::getSubscribeStatus, 1);
+            lq.eq(UserSubscribe::getBeforeStatus, 1);
+            UserSubscribe userSubscribe = iUserSubscribeService.getOne(lq);
+            if (userSubscribe != null) {
+                LambdaQueryWrapper<ExamBefore> lqw1 = Wrappers.lambdaQuery();
+                lqw1.eq(ExamBefore::getBeforeId, userSubscribe.getBeforeId());
+                lqw1.eq(ExamBefore::getStatus, 1);
+                ExamBefore examBefore = iExamBeforeService.getOne(lqw1);
+                if (examBefore != null) {
+                    if ((System.currentTimeMillis()/1000) > examBefore.getBeforeStartTime().longValue() && (System.currentTimeMillis()/1000) < examBefore.getBeforeEndTime().longValue()) {
+                        goodsUserVo.setBeforeStatus(1L);
+                        goodsUserVo.setBeforeName(examBefore.getBeforeName());
+                        goodsUserVo.setBeforeStartTime(examBefore.getBeforeStartTime());
+                        goodsUserVo.setBeforeEndTime(examBefore.getBeforeEndTime());
                     }
                 }
             }