src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -94,6 +94,11 @@ @PostMapping("/submit") public R submit(@RequestBody Apply apply) throws Exception { if (null==apply.getId()){ //查询人员是否已报名 Integer isApply = applyService.getIsApply(apply); if (null!=isApply){ return R.data(201,"已报名,不能重复报名"); } //去生成准考证号码 apply.setCandidateNo(getCandidateNo(apply)); //去生成考试编号 @@ -103,15 +108,19 @@ //默认为未考试状态 apply.setIsExam(1); apply.setApplyTime(new Date()); } boolean status = applyService.saveOrUpdate(apply); if (status){ //内网新增 arg.test01(arg.url+"/apply/save",apply); // arg.test01(arg.url+"/apply/save",apply); return R.data(200,"报名成功"); } //内网修改 if(null!=apply.getId()){ //修改 arg.test01(arg.url+"/apply/update",apply); } return R.status(applyService.saveOrUpdate(apply)); return R.data(202,"报名失败"); } src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.java
@@ -68,4 +68,11 @@ * @return */ ApplyPaPerVO getTrainApplyInfo(@Param("apply")Apply apply); /** * 查询人员是否已报名 * @param apply * @return */ Integer getIsApply(@Param("apply")Apply apply); } src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
@@ -184,4 +184,16 @@ and sa.exam_id = #{apply.examId} </if> </select> <!--查询人员是否已经报名--> <select id="getIsApply" resultType="java.lang.Integer"> select 1 from sys_apply where 1=1 and is_exam = 1 and user_id = #{apply.userId} and exam_id = #{apply.examId} and (apply_status = 1 or apply_status = 2) limit 1 </select> </mapper> src/main/java/org/springblade/modules/apply/service/ApplyService.java
@@ -66,4 +66,11 @@ * @param apply 报名对象 */ List<ApplyInfoExcel> getApplyExcelList(Apply apply); /** * 查询人员是否已报名 * @param apply * @return */ Integer getIsApply(Apply apply); } src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -284,4 +284,14 @@ public List<ApplyInfoExcel> getApplyExcelList(Apply apply) { return baseMapper.getApplyExcelList(apply); } /** * 查询人员是否已报名 * @param apply * @return */ @Override public Integer getIsApply(Apply apply) { return baseMapper.getIsApply(apply); } } src/main/java/org/springblade/modules/exam/entity/ExamPaper.java
@@ -52,7 +52,7 @@ private String examName; /** * 考试类型 * 考试类型 1 正式考试 2:模拟考试 */ private Integer examType; src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -122,6 +122,9 @@ <if test="paper.examName!=null and paper.examName!=''"> and exam_name like concat('%', #{paper.examName},'%') </if> <if test="paper.examType!=null"> and exam_type = #{paper.examType} </if> </select> <delete id="UnbindSubject">