Pārlūkot izejas kodu

预约考试地点展示

change 3 gadi atpakaļ
vecāks
revīzija
ee41e307a7

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -50,4 +50,6 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
     List<ExamUserApplySiteVo> subscribeApplySite(ExamApplyQueryBo bo);
 
     List<ExamUserApplySiteTimeVo> subscribeApplySiteTime(Long id);
+
+    Long registration(@Param("applyId")Long applyId,@Param("siteAddress") String siteAddress,@Param("startTime") String startTime,@Param("endTime") String endTime);
 }

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

@@ -2,11 +2,12 @@ package com.zhongzheng.modules.exam.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.vo.*;
 import com.zhongzheng.modules.user.vo.CalendarStudyVo;
 import io.swagger.annotations.ApiModelProperty;
@@ -15,9 +16,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
-import com.zhongzheng.modules.exam.bo.ExamApplyAddBo;
-import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
-import com.zhongzheng.modules.exam.bo.ExamApplyEditBo;
 import com.zhongzheng.modules.exam.domain.ExamApply;
 import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
@@ -218,6 +216,9 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             List<ExamUserApplySiteTimeVo> examApplySiteTime = baseMapper.subscribeApplySiteTime(examUserApplySiteVo.getId());
             for (ExamUserApplySiteTimeVo examUserApplySiteTimeVo : examApplySiteTime) {
                 List<ExamApplySiteTimeTwoVo> examApplySiteTimeTwoVos = JSONObject.parseArray(examUserApplySiteTimeVo.getSiteTime(), ExamApplySiteTimeTwoVo.class);
+                for (ExamApplySiteTimeTwoVo examApplySiteTimeTwoVo : examApplySiteTimeTwoVos) {
+                    examApplySiteTimeTwoVo.setRegistration(baseMapper.registration(examUserApplySiteVo.getApplyId(),examUserApplySiteVo.getSiteAddress(),examApplySiteTimeTwoVo.getStartTime(),examApplySiteTimeTwoVo.getEndTime()));
+                }
                 examUserApplySiteTimeVo.setExamApplySiteTimeTwoVo(examApplySiteTimeTwoVos);
             }
             examUserApplySiteVo.setExamUserApplySiteTime(examApplySiteTime);

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java

@@ -98,7 +98,7 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
                 List<ExamBefore> examBefore = this.list(new LambdaQueryWrapper<ExamBefore>()
                         .eq(ExamBefore::getBeforeName, update.getBeforeName())
                         .in(ExamBefore::getStatus,new ArrayList<Integer>(Arrays.asList(1,0)) ));
-                if (CollectionUtils.isNotEmpty(list)){
+                if (CollectionUtils.isNotEmpty(examBefore)){
                     throw new IllegalArgumentException("前培标题不可重复");
                 }
             }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplySiteTimeTwoVo.java

@@ -27,4 +27,7 @@ public class ExamApplySiteTimeTwoVo {
 
     @ApiModelProperty("报名人数")
     private Long registration;
+
+    @ApiModelProperty("1 当前时间该用户已有考试时间")
+    private Long status;
 }

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -317,4 +317,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="subscribeApplySiteTime" parameterType="Long" resultMap="ExamUserApplySiteTimeVo">
         SELECT * FROM exam_apply_site_time east where east.apply_site_id = #{id}
     </select>
+
+    <select id="registration" parameterType="map" resultType="long">
+        SELECT
+            COUNT( 1 )
+        FROM
+            user_subscribe us
+        WHERE
+            subscribe_status = 1
+          AND us.apply_id = #{applyId}
+          AND us.apply_site_adress = #{siteAddress}
+          AND us.apply_site_start_time =#{startTime}
+          AND us.apply_site_end_time =#{endTime}
+    </select>
 </mapper>