浏览代码

fix 前培

he2802 3 年之前
父节点
当前提交
4851b51552

+ 27 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -24,10 +24,8 @@ import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
-import com.zhongzheng.modules.exam.domain.ExamApplyGoods;
-import com.zhongzheng.modules.exam.domain.ExamApplyUser;
-import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
-import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.domain.*;
+import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
@@ -110,6 +108,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     @Autowired
     private IExamApplyUserService iExamApplyUserService;
     private IExamApplyUserService iExamApplyUserService;
 
 
+    @Autowired
+    private IExamBeforeApplyService iExamBeforeApplyService;
+
+    @Autowired
+    private IExamBeforeService iExamBeforeService;
+
 
 
 
 
     @Override
     @Override
@@ -403,6 +407,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsUserVo.getGoodsId());
             List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsUserVo.getGoodsId());
             if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
             if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {
                 List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
                 List<ExamApplyGoodsVo> examApplyGoodsVos = new ArrayList<>();
+                List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
                 examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
                 examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
                     LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
                     LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
                     lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
                     lqw.eq(ExamApplyUser::getApplyId, examApplyGoodsVo.getApplyId());
@@ -415,8 +420,26 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                         if (userIds.contains(bo.getUserId())) {
                         if (userIds.contains(bo.getUserId())) {
                             examApplyGoodsVos.add(examApplyGoodsVo);
                             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()) {
+                                goodsUserVo.setBeforeStatus(1L);
+                                goodsUserVo.setBeforeName(examBefore.getBeforeName());
+                            }
+                        }
                     }
                     }
                 });
                 });
+                examApplyGoodsVos.addAll(examApplyGoodsVos2);
                 goodsUserVo.setExamApplyGoodsList(examApplyGoodsVos);
                 goodsUserVo.setExamApplyGoodsList(examApplyGoodsVos);
             }
             }
         }
         }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeAddBo.java

@@ -67,4 +67,10 @@ public class UserMockSubscribeAddBo {
     /** 第一次交卷时间 */
     /** 第一次交卷时间 */
     @ApiModelProperty("第一次交卷时间")
     @ApiModelProperty("第一次交卷时间")
     private Long firstHandTime;
     private Long firstHandTime;
+    /** 开考提醒 0不开启 1开启 */
+    @ApiModelProperty("开考提醒 0不开启 1开启")
+    private Integer mockRemind;
+    /** 预约直播 0不预约 1预约 */
+    @ApiModelProperty("预约直播 0不预约 1预约")
+    private Integer liveSubscribe;
 }
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeEditBo.java

@@ -84,4 +84,11 @@ public class UserMockSubscribeEditBo {
     @ApiModelProperty("第一次交卷时间")
     @ApiModelProperty("第一次交卷时间")
     private Long firstHandTime;
     private Long firstHandTime;
 
 
+    /** 开考提醒 0不开启 1开启 */
+    @ApiModelProperty("开考提醒 0不开启 1开启")
+    private Integer mockRemind;
+    /** 预约直播 0不预约 1预约 */
+    @ApiModelProperty("预约直播 0不预约 1预约")
+    private Integer liveSubscribe;
+
 }
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserMockSubscribeQueryBo.java

@@ -113,4 +113,11 @@ public class UserMockSubscribeQueryBo extends BaseEntity {
 	/** 考试状态 0未考试 1已结束 */
 	/** 考试状态 0未考试 1已结束 */
 	@ApiModelProperty("考试状态 0未考试 1已结束")
 	@ApiModelProperty("考试状态 0未考试 1已结束")
 	private Integer mockStatus;
 	private Integer mockStatus;
+
+	/** 开考提醒 0不开启 1开启 */
+	@ApiModelProperty("开考提醒 0不开启 1开启")
+	private Integer mockRemind;
+	/** 预约直播 0不预约 1预约 */
+	@ApiModelProperty("预约直播 0不预约 1预约")
+	private Integer liveSubscribe;
 }
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserMockSubscribe.java

@@ -61,4 +61,8 @@ private static final long serialVersionUID=1L;
     private Long applySiteExamTime;
     private Long applySiteExamTime;
     /** 第一次交卷时间 */
     /** 第一次交卷时间 */
     private Long firstHandTime;
     private Long firstHandTime;
+    /** 开考提醒 0不开启 1开启 */
+    private Integer mockRemind;
+    /** 预约直播 0不预约 1预约 */
+    private Integer liveSubscribe;
 }
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserMockSubscribeServiceImpl.java

@@ -86,6 +86,8 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
         lqw.eq(StrUtil.isNotBlank(bo.getApplySiteEndTime()), UserMockSubscribe::getApplySiteEndTime, bo.getApplySiteEndTime());
         lqw.eq(StrUtil.isNotBlank(bo.getApplySiteEndTime()), UserMockSubscribe::getApplySiteEndTime, bo.getApplySiteEndTime());
         lqw.eq(bo.getApplySiteExamTime() != null, UserMockSubscribe::getApplySiteExamTime, bo.getApplySiteExamTime());
         lqw.eq(bo.getApplySiteExamTime() != null, UserMockSubscribe::getApplySiteExamTime, bo.getApplySiteExamTime());
         lqw.eq(bo.getFirstHandTime() != null, UserMockSubscribe::getFirstHandTime, bo.getFirstHandTime());
         lqw.eq(bo.getFirstHandTime() != null, UserMockSubscribe::getFirstHandTime, bo.getFirstHandTime());
+        lqw.eq(bo.getMockRemind() != null, UserMockSubscribe::getMockRemind, bo.getMockRemind());
+        lqw.eq(bo.getLiveSubscribe() != null, UserMockSubscribe::getLiveSubscribe, bo.getLiveSubscribe());
         return entity2Vo(this.list(lqw));
         return entity2Vo(this.list(lqw));
     }
     }
 
 
@@ -299,7 +301,9 @@ public class UserMockSubscribeServiceImpl extends ServiceImpl<UserMockSubscribeM
                     lq.eq(UserMockRecord::getEachExamId, userMockSubscribe.getEachExamId());
                     lq.eq(UserMockRecord::getEachExamId, userMockSubscribe.getEachExamId());
                     lq.last("limit 1");
                     lq.last("limit 1");
                     UserMockRecord userMockRecord = iUserMockRecordService.getOne(lq);
                     UserMockRecord userMockRecord = iUserMockRecordService.getOne(lq);
-                    userMockSubscribeVo.setRecordId(userMockRecord.getRecordId());
+                    if (userMockRecord != null) {
+                        userMockSubscribeVo.setRecordId(userMockRecord.getRecordId());
+                    }
                     userMockSubscribeVos.add(userMockSubscribeVo);
                     userMockSubscribeVos.add(userMockSubscribeVo);
                 });
                 });
                 mockMajorSubjectTimeList2.forEach(mockMajorSubjectTime -> {
                 mockMajorSubjectTimeList2.forEach(mockMajorSubjectTime -> {

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserMockSubscribeVo.java

@@ -202,4 +202,13 @@ public class UserMockSubscribeVo {
 	@Excel(name = "直播结束时间")
 	@Excel(name = "直播结束时间")
 	@ApiModelProperty("直播结束时间")
 	@ApiModelProperty("直播结束时间")
 	private Long liveEndTime;
 	private Long liveEndTime;
+
+	/** 开考提醒 0不开启 1开启 */
+	@Excel(name = "开考提醒 0不开启 1开启")
+	@ApiModelProperty("开考提醒 0不开启 1开启")
+	private Integer mockRemind;
+	/** 预约直播 0不预约 1预约 */
+	@Excel(name = "预约直播 0不预约 1预约")
+	@ApiModelProperty("预约直播 0不预约 1预约")
+	private Integer liveSubscribe;
 }
 }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMockSubscribeMapper.xml

@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="applySiteEndTime" column="apply_site_end_time"/>
         <result property="applySiteEndTime" column="apply_site_end_time"/>
         <result property="applySiteExamTime" column="apply_site_exam_time"/>
         <result property="applySiteExamTime" column="apply_site_exam_time"/>
         <result property="firstHandTime" column="first_hand_time"/>
         <result property="firstHandTime" column="first_hand_time"/>
+        <result property="mockRemind" column="mock_remind"/>
+        <result property="liveSubscribe" column="live_subscribe"/>
     </resultMap>
     </resultMap>
 
 
     <resultMap type="com.zhongzheng.modules.user.vo.UserMockSubscribeVo" id="UserMockSubscribeVoResult">
     <resultMap type="com.zhongzheng.modules.user.vo.UserMockSubscribeVo" id="UserMockSubscribeVoResult">
@@ -56,6 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectName" column="subject_name"/>
         <result property="subjectName" column="subject_name"/>
         <result property="timeLimit" column="time_limit"/>
         <result property="timeLimit" column="time_limit"/>
         <result property="firstHandTime" column="first_hand_time"/>
         <result property="firstHandTime" column="first_hand_time"/>
+        <result property="mockRemind" column="mock_remind"/>
+        <result property="liveSubscribe" column="live_subscribe"/>
     </resultMap>
     </resultMap>
     <select id="getInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
     <select id="getInfo" parameterType="java.lang.Long" resultMap="UserMockSubscribeVoResult">
         SELECT 	ums.*,
         SELECT 	ums.*,