Przeglądaj źródła

预约考试地点展示

change 3 lat temu
rodzic
commit
dff8e48983

+ 13 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java

@@ -57,7 +57,7 @@ public class ExamApplyController extends BaseController {
     /**
      * 获取考试安排详细信息
      */
-    @ApiOperation("预约报考下一步按钮 1 进入有前陪有考试地点得预约考试  2进入无前陪有考试地点预约考试 3无考试次数购买商品")
+    @ApiOperation("预约报考下一步按钮 1 进入有考陪有考试地点得预约考试  2进入无考陪有考试地点预约考试 3无考试次数购买商品")
     @GetMapping("/subscribeNext")
     public AjaxResult<Long> subscribeNext(ExamApplyQueryBo bo) {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
@@ -79,5 +79,17 @@ public class ExamApplyController extends BaseController {
         return AjaxResult.success(count);
     }
 
+    /**
+     * 获取考试安排详细信息
+     */
+    @ApiOperation("获得考试的考培地点")
+    @GetMapping("/subscribeApplySiteTrain")
+    public AjaxResult<List<ExamUserApplySiteVo>> subscribeApplySiteTrain(ExamApplyQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        List<ExamUserApplySiteVo> count = iExamApplyService.subscribeApplySiteTrain(bo);
+        return AjaxResult.success(count);
+    }
+
 
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -51,5 +51,7 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
 
     List<ExamUserApplySiteTimeVo> subscribeApplySiteTime(Long id);
 
-    Long registration(@Param("applyId")Long applyId,@Param("siteAddress") String siteAddress,@Param("startTime") String startTime,@Param("endTime") String endTime);
+    Long registration(@Param("applyId")Long applyId,@Param("examTime") Long examTime,@Param("siteAddress") String siteAddress,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
+    Long userStatus(@Param("userId") Long userId,@Param("examTime") Long examTime,@Param("startTime") String startTime,@Param("endTime") String endTime);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyService.java

@@ -62,4 +62,6 @@ public interface IExamApplyService extends IService<ExamApply> {
     Long subscribeNext(ExamApplyQueryBo bo);
 
     List<ExamUserApplySiteVo> subscribeApplySite(ExamApplyQueryBo bo);
+
+	List<ExamUserApplySiteVo> subscribeApplySiteTrain(ExamApplyQueryBo bo);
 }

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

@@ -217,7 +217,29 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             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()));
+                    examApplySiteTimeTwoVo.setRegistration(baseMapper.registration(examUserApplySiteVo.getApplyId(), examUserApplySiteTimeVo.getExamTime()
+                            ,examUserApplySiteVo.getSiteAddress(),examApplySiteTimeTwoVo.getStartTime(),examApplySiteTimeTwoVo.getEndTime()));
+                    examApplySiteTimeTwoVo.setStatus(baseMapper.userStatus(bo.getUserId(),examUserApplySiteTimeVo.getExamTime(),examApplySiteTimeTwoVo.getStartTime(),examApplySiteTimeTwoVo.getEndTime()));
+                }
+                examUserApplySiteTimeVo.setExamApplySiteTimeTwoVo(examApplySiteTimeTwoVos);
+            }
+            examUserApplySiteVo.setExamUserApplySiteTime(examApplySiteTime);
+        }
+        return examUserApplySiteVos;
+    }
+
+    @Override
+    public List<ExamUserApplySiteVo> subscribeApplySiteTrain(ExamApplyQueryBo bo) {
+        List<ExamUserApplySiteVo> examUserApplySiteVos= baseMapper.subscribeApplySite(bo);
+        //获得详细地址查看是否满员
+        for (ExamUserApplySiteVo examUserApplySiteVo : examUserApplySiteVos) {
+            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(), examUserApplySiteTimeVo.getExamTime()
+                            ,examUserApplySiteVo.getSiteAddress(),examApplySiteTimeTwoVo.getStartTime(),examApplySiteTimeTwoVo.getEndTime()));
+                    examApplySiteTimeTwoVo.setStatus(baseMapper.userStatus(bo.getUserId(),examUserApplySiteTimeVo.getExamTime(),examApplySiteTimeTwoVo.getStartTime(),examApplySiteTimeTwoVo.getEndTime()));
                 }
                 examUserApplySiteTimeVo.setExamApplySiteTimeTwoVo(examApplySiteTimeTwoVos);
             }

+ 17 - 1
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         goods_name,
         CODE,
         stand_price,
-        (case WHEN (SELECT COUNT(ea.apply_id) FROM exam_apply ea LEFT JOIN exam_apply_goods eag on ea.apply_id =eag.apply_id where 1=1 and eag.goods_id = g.goods_id and ea.status =1) >0 then 0 ELSE 1 end) as goods_status
+        (case WHEN (SELECT COUNT(ea.apply_id) FROM exam_apply ea LEFT JOIN exam_apply_goods eag on ea.apply_id =eag.apply_id where 1=1 and eag.goods_id = g.goods_id and ea.status in (0,1)) >0 then 0 ELSE 1 end) as goods_status
         FROM
         goods g
         WHERE
@@ -312,6 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN exam_site es ON es.site_id = eas.site_id
         WHERE
             eas.apply_id = #{applyId}
+            and eas.status = 1
     </select>
 
     <select id="subscribeApplySiteTime" parameterType="Long" resultMap="ExamUserApplySiteTimeVo">
@@ -326,8 +327,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
             subscribe_status = 1
           AND us.apply_id = #{applyId}
+          AND us.apply_site_exam_time = #{examTime}
           AND us.apply_site_adress = #{siteAddress}
           AND us.apply_site_start_time =#{startTime}
           AND us.apply_site_end_time =#{endTime}
     </select>
+
+
+    <select id="userStatus" parameterType="map" resultType="long">
+        SELECT
+            COUNT( 1 )
+        FROM
+            user_subscribe us
+        WHERE
+            subscribe_status = 1
+          AND us.apply_site_exam_time = #{examTime}
+          AND us.user_id = #{userId}
+          AND us.apply_site_start_time =#{startTime}
+          AND us.apply_site_end_time =#{endTime}
+    </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeMapper.xml

@@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         goods_name,
         CODE,
         stand_price,
-        (case WHEN (SELECT COUNT(eb.before_id) FROM exam_before eb LEFT JOIN exam_before_goods ebg on eb.before_id =ebg.before_id where 1=1 and ebg.goods_id = g.goods_id and eb.status =1) >0 then 0 ELSE 1 end) as goods_status
+        (case WHEN (SELECT COUNT(eb.before_id) FROM exam_before eb LEFT JOIN exam_before_goods ebg on eb.before_id =ebg.before_id where 1=1 and ebg.goods_id = g.goods_id and eb.status in (0,1)) >0 then 0 ELSE 1 end) as goods_status
         FROM
         goods g
         WHERE

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamNumberGoodsMapper.xml

@@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         goods_name,
         CODE,
         stand_price,
-        (case WHEN (SELECT COUNT(en.exam_number_id) FROM exam_number en LEFT JOIN exam_number_goods eng on en.exam_number_id =eng.exam_number_id where 1=1 and eng.goods_id = g.goods_id and en.status =1) >0 then 0 ELSE 1 end) as goods_status
+        (case WHEN (SELECT COUNT(en.exam_number_id) FROM exam_number en LEFT JOIN exam_number_goods eng on en.exam_number_id =eng.exam_number_id where 1=1 and eng.goods_id = g.goods_id and en.status in (0,1)) >0 then 0 ELSE 1 end) as goods_status
         FROM
         goods g
         WHERE