src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -19,6 +19,7 @@ import org.springblade.modules.apply.excel.ApplyExcel; import org.springblade.modules.apply.excel.ApplyImporter; import org.springblade.modules.apply.service.ApplyService; import org.springblade.modules.apply.vo.ApplyPaPerVO; import org.springblade.modules.apply.vo.ApplyVO; import org.springblade.modules.exam.entity.ExamPaper; import org.springblade.modules.exam.service.ExamPaperService; @@ -288,4 +289,20 @@ return R.data(detail); } /** * 获取准考证信息 * @param apply * @return */ @GetMapping("/getApplyInfo") public R<ApplyPaPerVO> getApplyInfo(Apply apply,HttpServletResponse response) { response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Allow-Credentials", "true"); //查询考试报名详情 ApplyPaPerVO detail = applyService.getApplyInfo(apply); //返回 return R.data(detail); } } src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import org.springblade.modules.apply.entity.Apply; import org.springblade.modules.apply.vo.ApplyPaPerVO; import org.springblade.modules.apply.vo.ApplyVO; import java.util.List; @@ -44,4 +45,11 @@ * @return */ Integer getApplyNum(@Param("applyCode") String applyCode); /** * 获取准考证信息 * @param apply * @return */ ApplyPaPerVO getApplyInfo(@Param("apply")Apply apply); } src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
@@ -80,4 +80,29 @@ <select id="getApplyNum" resultType="java.lang.Integer"> select count(*) from sys_apply where apply_code = #{applyCode} </select> <!--获取准考证信息--> <select id="getApplyInfo" resultType="org.springblade.modules.apply.vo.ApplyPaPerVO"> SELECT sa.id,sa.candidate_no candidateNo, ke.exam_type examType,ke.start_time startTime,ke.end_time endTime,ke.exam_name examName, bu.real_name realName,bu.cardid idCardNo,ifnull(bu.sex,0) sex, bd.dept_name deptName,"保安证" applyCard FROM sys_apply sa left join ksxt_exam ke on sa.exam_id = ke.id left join blade_user bu on sa.user_id = bu.id left join blade_dept bd on bd.id = bu.dept_id WHERE sa.id = #{apply.id} </select> </mapper> src/main/java/org/springblade/modules/apply/service/ApplyService.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.modules.apply.entity.Apply; import org.springblade.modules.apply.excel.ApplyExcel; import org.springblade.modules.apply.vo.ApplyPaPerVO; import org.springblade.modules.apply.vo.ApplyVO; import java.util.List; @@ -51,4 +52,11 @@ * @return */ void importApply(List<ApplyExcel> data, Boolean isCovered); /** * 获取准考证信息 * @param apply * @return */ ApplyPaPerVO getApplyInfo(Apply apply); } src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -13,6 +13,7 @@ import org.springblade.modules.apply.excel.ApplyExcel; import org.springblade.modules.apply.mapper.ApplyMapper; import org.springblade.modules.apply.service.ApplyService; import org.springblade.modules.apply.vo.ApplyPaPerVO; import org.springblade.modules.apply.vo.ApplyVO; import org.springblade.modules.exam.entity.ExamPaper; import org.springblade.modules.exam.service.ExamPaperService; @@ -230,4 +231,20 @@ } return pinyinStr; } /** * 获取准考证信息 * @param apply * @return */ @Override public ApplyPaPerVO getApplyInfo(Apply apply) { ApplyPaPerVO applyPaPerVO = baseMapper.getApplyInfo(apply); String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0]; String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1]; String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1]; applyPaPerVO.setStringTime(time+" "+startTime.substring(0,startTime.length()-3) +"-"+ endTime.substring(0,endTime.length()-3)); return applyPaPerVO; } } src/main/java/org/springblade/modules/apply/vo/ApplyPaPerVO.java
New file @@ -0,0 +1,94 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.apply.vo; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springblade.modules.apply.entity.Apply; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; /** * 考试报名实体类 * * @author zhongrj * @since 2021-07-17 */ @Data @TableName("sys_apply") public class ApplyPaPerVO extends Apply implements Serializable { private static final long serialVersionUID = 1L; /** * 考试类型 */ private Integer examType; /** * 考试名称 */ private String examName; /** * 保安单位名称 */ private String deptName; /** * 身份证号 */ private String idCardNo; /** * 报考的证件 */ private String applyCard; /** * 真实姓名 */ private String realName; /** * 性别 */ private Integer sex; /** * 考试开始时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startTime; /** * 考试结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endTime; private String stringTime; }