yangdamao 2 年之前
父節點
當前提交
0bb60f098d

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -279,7 +279,7 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         update.setUpdateTime(DateUtils.getNowTime());
         this.updateById(update);
 
-        if (update.getApplyNature() == 2) {
+        if (ObjectUtils.isNotNull(update.getApplyNature()) && update.getApplyNature() == 2) {
             //专场预约学员
             iExamApplyUserService.remove(new LambdaQueryWrapper<ExamApplyUser>().eq(ExamApplyUser::getApplyId, update.getApplyId()));
             if (StringUtils.isNotBlank(bo.getNatureUrl())) {
@@ -593,10 +593,12 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             List<ExamApplySiteTimeTwoVo> examApplySiteTimeTwoVos = JSONArray.parseArray(item.getSiteTime(), ExamApplySiteTimeTwoVo.class);
             if (ObjectUtils.isNotNull(examApplySiteTimeTwoVos)) {
                 ExamApplySiteTimeTwoVo timeTwoVo = examApplySiteTimeTwoVos.stream().findFirst().orElse(null);
+                ExamApplySite applySite = iExamApplySiteService.getById(item.getApplySiteId());
                 //预约人数
                 int count = iUserSubscribeService.count(new LambdaQueryWrapper<UserSubscribe>()
                         .eq(UserSubscribe::getApplyId, item.getApplyId())
-                        .eq(UserSubscribe::getSiteId, item.getApplySiteId())
+                        .eq(UserSubscribe::getSiteId, applySite.getSiteId())
+                        .eq(UserSubscribe::getSubscribeStatus, 1)
                         .eq(UserSubscribe::getApplySiteStartTime, timeTwoVo.getStartTime())
                         .eq(UserSubscribe::getApplySiteEndTime, timeTwoVo.getEndTime()));
                 item.setPeople(count);

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

@@ -180,10 +180,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND ums.apply_site_exam_time &lt; #{endTime}
         </if>
         <if test="startScore != null and startScore != ''">
-            AND ums.performance &gt;= #{startScore}
+            AND (SELECT performance FROM user_mock_record umr WHERE umr.user_id = ums.user_id AND umr.each_exam_id = ums.each_exam_id ORDER BY umr.create_time limit 1) &gt;= #{startScore}
         </if>
         <if test="endScore != null and endScore != ''">
-            AND ums.performance &lt;= #{endScore}
+            AND (SELECT performance FROM user_mock_record umr WHERE umr.user_id = ums.user_id AND umr.each_exam_id = ums.each_exam_id ORDER BY umr.create_time limit 1) &lt;= #{endScore}
         </if>
         order by ums.create_time desc
     </select>