考试报名接口
This commit is contained in:
parent
e043412446
commit
71197d9677
@ -69,7 +69,7 @@ public class JwtUtils {
|
||||
public static String sign(String username) {
|
||||
Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME);
|
||||
Algorithm algorithm = Algorithm.HMAC256(encryptSecret(username));
|
||||
// 附带username信息
|
||||
// 附带username信息ExpiredJwtException
|
||||
return JWT.create()
|
||||
.withClaim("username", username)
|
||||
.withExpiresAt(date).sign(algorithm);
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
package com.yf.exam.ability.upload.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @description: 上传文件存放路径配置
|
||||
* @author: haown
|
||||
* @create: 2025-07-11 15:21
|
||||
**/
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "conf.folder")
|
||||
public class UploadPathConfig {
|
||||
|
||||
/**
|
||||
* 身份证正面照片路径上传
|
||||
*/
|
||||
private String cardFrontUrl;
|
||||
|
||||
/**
|
||||
* 身份证背面照片路径上传
|
||||
*/
|
||||
private String cardBackUrl;
|
||||
|
||||
/**
|
||||
* 身份证正反面复印件
|
||||
*/
|
||||
private String cardCopyUrl;
|
||||
|
||||
/**
|
||||
* 证件照
|
||||
*/
|
||||
private String photoUrl;
|
||||
|
||||
/**
|
||||
* 学历证明
|
||||
*/
|
||||
private String certificateUrl;
|
||||
|
||||
/**
|
||||
* 体检报告
|
||||
*/
|
||||
private String physicalReportUrl;
|
||||
|
||||
/**
|
||||
* 签名图片
|
||||
*/
|
||||
private String signPictureUrl;
|
||||
|
||||
}
|
||||
@ -36,7 +36,7 @@ public class UploadController extends BaseController {
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/common/api/file/upload")
|
||||
@PostMapping("/exam/api/file/upload")
|
||||
@ApiOperation(value = "文件上传", notes = "此接口较为特殊,参数都通过表单方式提交,而非JSON")
|
||||
public ApiRest<UploadRespDTO> upload(@ModelAttribute UploadReqDTO reqDTO) {
|
||||
// 上传并返回URL
|
||||
|
||||
@ -19,4 +19,7 @@ public class UploadReqDTO extends BaseDTO {
|
||||
@ApiModelProperty(value = "上传文件内容", required=true)
|
||||
private MultipartFile file;
|
||||
|
||||
@ApiModelProperty(value = "文件类型", required=true)
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
||||
@ -2,26 +2,28 @@ package com.yf.exam.ability.upload.service.impl;
|
||||
|
||||
import com.yf.exam.ability.Constant;
|
||||
import com.yf.exam.ability.upload.config.UploadConfig;
|
||||
import com.yf.exam.ability.upload.config.UploadPathConfig;
|
||||
import com.yf.exam.ability.upload.dto.UploadReqDTO;
|
||||
import com.yf.exam.ability.upload.dto.UploadRespDTO;
|
||||
import com.yf.exam.ability.upload.service.UploadService;
|
||||
import com.yf.exam.ability.upload.utils.FileUtils;
|
||||
import com.yf.exam.constant.Constants;
|
||||
import com.yf.exam.core.exception.ServiceException;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.yf.exam.core.utils.StringUtils;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
@ -35,11 +37,15 @@ public class UploadServiceImpl implements UploadService {
|
||||
|
||||
@Autowired
|
||||
private UploadConfig conf;
|
||||
@Autowired
|
||||
private UploadPathConfig uploadPathConfig;
|
||||
|
||||
@Override
|
||||
public UploadRespDTO upload(UploadReqDTO reqDTO) {
|
||||
|
||||
|
||||
if(StringUtils.isBlank(reqDTO.getType())){
|
||||
throw new ServiceException("请选择所要上传的路径类型");
|
||||
}
|
||||
// 文件内容
|
||||
MultipartFile file = reqDTO.getFile();
|
||||
|
||||
@ -50,6 +56,36 @@ public class UploadServiceImpl implements UploadService {
|
||||
}
|
||||
// 上传文件夹
|
||||
String fileDir = conf.getDir();
|
||||
switch (reqDTO.getType()) {
|
||||
//身份证正面上传
|
||||
case Constants.card_front_type:
|
||||
fileDir += uploadPathConfig.getCardFrontUrl();
|
||||
break;
|
||||
//身份证背面上传
|
||||
case Constants.card_back_type:
|
||||
fileDir += uploadPathConfig.getCardBackUrl();
|
||||
break;
|
||||
//身份证背面上传
|
||||
case Constants.card_copy_type:
|
||||
fileDir += uploadPathConfig.getCardCopyUrl();
|
||||
break;
|
||||
//证件照上传
|
||||
case Constants.photo_type:
|
||||
fileDir += uploadPathConfig.getPhotoUrl();
|
||||
break;
|
||||
//学历证明上传
|
||||
case Constants.certificate_type:
|
||||
fileDir += uploadPathConfig.getCertificateUrl();
|
||||
break;
|
||||
//体检报告上传
|
||||
case Constants.physical_report_type:
|
||||
fileDir += uploadPathConfig.getPhysicalReportUrl();
|
||||
break;
|
||||
//签名图片上传
|
||||
case Constants.sign_picture_type:
|
||||
fileDir += uploadPathConfig.getSignPictureUrl();
|
||||
break;
|
||||
}
|
||||
// 真实物理地址
|
||||
String fullPath;
|
||||
try {
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
package com.yf.exam.ability.upload.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.yf.exam.core.utils.DateUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.util.Date;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件工具类
|
||||
@ -145,9 +143,9 @@ public class FileUtils {
|
||||
fileName = renameFile(fileName);
|
||||
|
||||
//获得上传的文件夹
|
||||
String dir = DateUtils.formatDate(new Date(), "yyyy/MM/dd/");
|
||||
//String dir = DateUtils.formatDate(new Date(), "yyyy/MM/dd/");
|
||||
|
||||
return new StringBuffer(dir).append(fileName).toString();
|
||||
return new StringBuffer(fileName).toString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ public class ShiroConfig {
|
||||
map.put("/exam/api/sys/user/login", "anon");
|
||||
map.put("/exam/api/sys/user/reg", "anon");
|
||||
map.put("/exam/api/sys/user/quick-reg", "anon");
|
||||
map.put("/exam/api/sys/user/info", "anon");
|
||||
|
||||
// 获取网站基本信息
|
||||
map.put("/exam/api/sys/config/detail", "anon");
|
||||
|
||||
47
exam-admin/src/main/java/com/yf/exam/constant/Constants.java
Normal file
47
exam-admin/src/main/java/com/yf/exam/constant/Constants.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.yf.exam.constant;
|
||||
|
||||
/**
|
||||
* 通用常量信息
|
||||
*
|
||||
* @author haoen
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
/**
|
||||
* 身份证正面照片路径上传
|
||||
*/
|
||||
public static final String card_front_type = "cardFrontUrl";
|
||||
|
||||
/**
|
||||
* 身份证背面照片路径上传
|
||||
*/
|
||||
public static final String card_back_type = "cardBackUrl";
|
||||
|
||||
/**
|
||||
* 身份证正反面复印件路径上传
|
||||
*/
|
||||
public static final String card_copy_type = "cardCopyUrl";
|
||||
|
||||
/**
|
||||
* 证件照路径上传
|
||||
*/
|
||||
public static final String photo_type = "photoUrl";
|
||||
|
||||
/**
|
||||
* 学历证明
|
||||
*/
|
||||
public static final String certificate_type = "certificateUrl";
|
||||
|
||||
/**
|
||||
* 健康体检报告
|
||||
*/
|
||||
public static final String physical_report_type = "physicalReportUrl";
|
||||
|
||||
/**
|
||||
* 签字照片
|
||||
*/
|
||||
public static final String sign_picture_type = "signPictureUrl";
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -16,6 +16,8 @@ import com.yf.exam.modules.exam.entity.Exam;
|
||||
import com.yf.exam.modules.exam.service.ExamService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -23,8 +25,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试控制器
|
||||
@ -103,11 +103,11 @@ public class ExamController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查找
|
||||
* 模拟考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "考试视角")
|
||||
@ApiOperation(value = "模拟考试列表")
|
||||
@RequestMapping(value = "/online-paging", method = { RequestMethod.POST})
|
||||
public ApiRest<IPage<ExamOnlineRespDTO>> myPaging(@RequestBody PagingReqDTO<ExamDTO> reqDTO) {
|
||||
|
||||
@ -147,5 +147,17 @@ public class ExamController extends BaseController {
|
||||
return super.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询可考试列表")
|
||||
@RequestMapping(value = "/getExamList", method = { RequestMethod.GET})
|
||||
public ApiRest getExamList(ExamDTO reqDTO) {
|
||||
List<ExamDTO> list = baseService.getExamList(reqDTO);
|
||||
return super.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package com.yf.exam.modules.exam.controller;
|
||||
|
||||
import com.yf.exam.core.api.ApiRest;
|
||||
import com.yf.exam.core.api.controller.BaseController;
|
||||
import com.yf.exam.modules.exam.dto.ExamRegistrationDTO;
|
||||
import com.yf.exam.modules.exam.service.ExamRegistrationService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @description: 考试报名控制器
|
||||
* @author: haown
|
||||
* @create: 2025-07-11 10:14
|
||||
**/
|
||||
@Api(tags={"考试报名"})
|
||||
@RestController
|
||||
@RequestMapping("/exam/api/exam/registration")
|
||||
public class ExamRegistrationController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ExamRegistrationService baseService;
|
||||
|
||||
/**
|
||||
* 添加或修改
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加或修改")
|
||||
@RequestMapping(value = "/save", method = { RequestMethod.POST})
|
||||
public ApiRest save(@RequestBody ExamRegistrationDTO reqDTO) {
|
||||
//复制参数
|
||||
baseService.save(reqDTO);
|
||||
return super.success();
|
||||
}
|
||||
}
|
||||
@ -4,12 +4,14 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yf.exam.modules.paper.enums.ExamState;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试数据传输类
|
||||
@ -38,21 +40,44 @@ public class ExamDTO implements Serializable {
|
||||
@ApiModelProperty(value = "1公开2部门3定员", required=true)
|
||||
private Integer openType;
|
||||
|
||||
@ApiModelProperty(value = "考试状态", required=true)
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试)", required=true)
|
||||
private Integer examType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "考试状态", required=true)
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "是否限时", required=true)
|
||||
private Boolean timeLimit;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始时间", required=true)
|
||||
private Date startTime;
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "开始日期", required=true)
|
||||
private LocalDate startDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "结束日期", required=true)
|
||||
private LocalDate endDate;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "HH:mm")
|
||||
@DateTimeFormat(pattern = "HH:mm")
|
||||
@ApiModelProperty(value = "开始时间", required=true)
|
||||
private LocalTime startTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "HH:mm")
|
||||
@DateTimeFormat(pattern = "HH:mm")
|
||||
@ApiModelProperty(value = "结束时间", required=true)
|
||||
private Date endTime;
|
||||
private LocalTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required=true)
|
||||
private Date createTime;
|
||||
@ -69,7 +94,11 @@ public class ExamDTO implements Serializable {
|
||||
@ApiModelProperty(value = "及格分数", required=true)
|
||||
private Integer qualifyScore;
|
||||
|
||||
|
||||
/**
|
||||
* 考试费用
|
||||
*/
|
||||
@ApiModelProperty(value = "考试费用", required=true)
|
||||
private BigDecimal examFee;
|
||||
|
||||
|
||||
/**
|
||||
@ -80,16 +109,16 @@ public class ExamDTO implements Serializable {
|
||||
|
||||
if(this.timeLimit!=null && this.timeLimit){
|
||||
|
||||
if(System.currentTimeMillis() < startTime.getTime() ){
|
||||
if(startDate.isAfter(LocalDate.now())){
|
||||
return ExamState.READY_START;
|
||||
}
|
||||
|
||||
if(System.currentTimeMillis() > endTime.getTime()){
|
||||
if(endDate.isBefore(LocalDate.now())){
|
||||
return ExamState.OVERDUE;
|
||||
}
|
||||
|
||||
if(System.currentTimeMillis() > startTime.getTime()
|
||||
&& System.currentTimeMillis() < endTime.getTime()
|
||||
if(startDate.isBefore(LocalDate.now())
|
||||
&& endDate.isAfter(LocalDate.now())
|
||||
&& !ExamState.DISABLED.equals(this.state)){
|
||||
return ExamState.ENABLE;
|
||||
}
|
||||
|
||||
@ -0,0 +1,173 @@
|
||||
package com.yf.exam.modules.exam.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* @description: 考试报名数据传输类
|
||||
* @author: haown
|
||||
* @create: 2025-07-11 10:05
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value="报名", description="报名")
|
||||
public class ExamRegistrationDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty(value = "ID", required=true)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@ApiModelProperty(value = "用户主键", required=true)
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户名(考生账号的用户名是身份证号)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名(考生账号的用户名是身份证号)", required=true)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "姓名", required=true)
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号", required=true)
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 考试表主键
|
||||
*/
|
||||
@ApiModelProperty(value = "考试表主键", required=true)
|
||||
private String examId;
|
||||
|
||||
/**
|
||||
* 考试名称
|
||||
*/
|
||||
@ApiModelProperty(value = "考试名称", required=true)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "电子邮箱", required=true)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 通讯地址
|
||||
*/
|
||||
@ApiModelProperty(value = "通讯地址", required=true)
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 最高学历,1:初中,2:高中/中专,3:大专及以上
|
||||
*/
|
||||
@ApiModelProperty(value = "最高学历,1:初中,2:高中/中专,3:大专及以上", required=true)
|
||||
private Integer education;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
@ApiModelProperty(value = "毕业院校", required=true)
|
||||
private String graduateSchool;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
@ApiModelProperty(value = "专业", required=true)
|
||||
private String major;
|
||||
|
||||
/**
|
||||
* 报考类别(1:普通医疗护理员,2:老年医疗护理员,3:孕产妇和新生儿医疗护理员)
|
||||
*/
|
||||
@ApiModelProperty(value = "报考类别(1:普通医疗护理员,2:老年医疗护理员,3:孕产妇和新生儿医疗护理员)", required=true)
|
||||
private Integer regType;
|
||||
|
||||
/**
|
||||
* 培训机构
|
||||
*/
|
||||
@ApiModelProperty(value = "培训机构")
|
||||
private String trainInstitution;
|
||||
|
||||
/**
|
||||
* 培训开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "培训开始时间")
|
||||
private LocalDate trainStartDate;
|
||||
|
||||
/**
|
||||
* 培训结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "培训结束时间")
|
||||
private LocalDate trainEndDate;
|
||||
|
||||
/**
|
||||
* 身份证正面照片
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证正面照片")
|
||||
private String cardFront;
|
||||
|
||||
/**
|
||||
* 身份证背面照片
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证背面照片")
|
||||
private String cardBack;
|
||||
|
||||
/**
|
||||
* 身份证正反面复印件
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证正反面复印件")
|
||||
private String cardCopy;
|
||||
|
||||
/**
|
||||
* 证件照
|
||||
*/
|
||||
@ApiModelProperty(value = "证件照", required=true)
|
||||
private String photo;
|
||||
|
||||
/**
|
||||
* 学历证明
|
||||
*/
|
||||
@ApiModelProperty(value = "学历证明", required=true)
|
||||
private String certificate;
|
||||
|
||||
/**
|
||||
* 健康体检报告
|
||||
*/
|
||||
@ApiModelProperty(value = "健康体检报告", required=true)
|
||||
private String physicalReport;
|
||||
|
||||
/**
|
||||
* 签名图片
|
||||
*/
|
||||
@ApiModelProperty(value = "签名图片", required=true)
|
||||
private String signPicture;
|
||||
|
||||
/**
|
||||
* 报名时间
|
||||
*/
|
||||
@ApiModelProperty(value = "报名时间", required=true)
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate regTime;
|
||||
|
||||
/**
|
||||
* 考试状态(0:未考试,1:已考试)
|
||||
*/
|
||||
@ApiModelProperty(value = "考试状态(0:未考试,1:已考试)", required=true)
|
||||
private Integer examState;
|
||||
}
|
||||
@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -44,6 +47,11 @@ public class Exam extends Model<Exam> {
|
||||
@TableField("open_type")
|
||||
private Integer openType;
|
||||
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试)
|
||||
* */
|
||||
private Integer examType;
|
||||
|
||||
/**
|
||||
* 考试状态
|
||||
*/
|
||||
@ -55,17 +63,29 @@ public class Exam extends Model<Exam> {
|
||||
@TableField("time_limit")
|
||||
private Boolean timeLimit;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@TableField("start_date")
|
||||
private LocalDate startDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@TableField("end_date")
|
||||
private LocalDate endDate;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField("start_time")
|
||||
private Date startTime;
|
||||
private LocalTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField("end_time")
|
||||
private Date endTime;
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@ -96,5 +116,11 @@ public class Exam extends Model<Exam> {
|
||||
*/
|
||||
@TableField("qualify_score")
|
||||
private Integer qualifyScore;
|
||||
|
||||
/**
|
||||
* 考试费用
|
||||
*/
|
||||
@TableField("exam_fee")
|
||||
private BigDecimal examFee;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,166 @@
|
||||
package com.yf.exam.modules.exam.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 考试报名信息表
|
||||
* @author: haown
|
||||
* @create: 2025-07-11 09:31
|
||||
**/
|
||||
@Data
|
||||
@TableName("el_exam_registration")
|
||||
public class ExamRegistration extends Model<ExamRegistration> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户主键
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户名(考生账号的用户名是身份证号)
|
||||
*/
|
||||
@TableField("user_name")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@TableField("real_name")
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 考试表主键
|
||||
*/
|
||||
@TableField("exam_id")
|
||||
private String examId;
|
||||
|
||||
/**
|
||||
* 考试名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 电子邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 通讯地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 最高学历,1:初中,2:高中/中专,3:大专及以上
|
||||
*/
|
||||
private Integer education;
|
||||
|
||||
/**
|
||||
* 毕业院校
|
||||
*/
|
||||
private String graduateSchool;
|
||||
|
||||
/**
|
||||
* 专业
|
||||
*/
|
||||
private String major;
|
||||
|
||||
/**
|
||||
* 报考类别(1:普通医疗护理员,2:老年医疗护理员,3:孕产妇和新生儿医疗护理员)
|
||||
*/
|
||||
private Integer regType;
|
||||
|
||||
/**
|
||||
* 培训机构
|
||||
*/
|
||||
private String trainInstitution;
|
||||
|
||||
/**
|
||||
* 培训开始时间
|
||||
*/
|
||||
private LocalDate trainStartDate;
|
||||
|
||||
/**
|
||||
* 培训结束时间
|
||||
*/
|
||||
private LocalDate trainEndDate;
|
||||
|
||||
/**
|
||||
* 身份证正面照片
|
||||
*/
|
||||
private String cardFront;
|
||||
|
||||
/**
|
||||
* 身份证背面照片
|
||||
*/
|
||||
private String cardBack;
|
||||
|
||||
/**
|
||||
* 身份证正反面复印件
|
||||
*/
|
||||
private String cardCopy;
|
||||
|
||||
/**
|
||||
* 证件照
|
||||
*/
|
||||
private String photo;
|
||||
|
||||
/**
|
||||
* 学历证明
|
||||
*/
|
||||
private String certificate;
|
||||
|
||||
/**
|
||||
* 健康体检报告
|
||||
*/
|
||||
private String physicalReport;
|
||||
|
||||
/**
|
||||
* 签名图片
|
||||
*/
|
||||
private String signPicture;
|
||||
|
||||
/**
|
||||
* 报名时间
|
||||
*/
|
||||
private LocalDate regTime;
|
||||
|
||||
/**
|
||||
* 考试状态(0:未考试,1:已考试)
|
||||
*/
|
||||
private Integer examState;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yf.exam.modules.exam.dto.ExamDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamReviewRespDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamOnlineRespDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamReviewRespDTO;
|
||||
import com.yf.exam.modules.exam.entity.Exam;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -42,4 +43,11 @@ public interface ExamMapper extends BaseMapper<Exam> {
|
||||
* @return
|
||||
*/
|
||||
IPage<ExamOnlineRespDTO> online(Page page, @Param("query") ExamDTO query);
|
||||
|
||||
/**
|
||||
* 查询可预约考试列表
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<ExamDTO> getExamList(@Param("query") ExamDTO query);
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.yf.exam.modules.exam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yf.exam.modules.exam.entity.ExamRegistration;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试报名Mapper
|
||||
* </p>
|
||||
*
|
||||
* @author haown
|
||||
* @since 2025-07-11 10:25
|
||||
*/
|
||||
public interface ExamRegistrationMapper extends BaseMapper<ExamRegistration> {
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.yf.exam.modules.exam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yf.exam.modules.exam.dto.ExamRegistrationDTO;
|
||||
import com.yf.exam.modules.exam.entity.ExamRegistration;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 考试报名业务类
|
||||
* </p>
|
||||
*
|
||||
* @author haown
|
||||
* @since 2025-07-11 10:20
|
||||
*/
|
||||
public interface ExamRegistrationService extends IService<ExamRegistration> {
|
||||
|
||||
/**
|
||||
* 保存报名信息
|
||||
* @param reqDTO
|
||||
*/
|
||||
void save(ExamRegistrationDTO reqDTO);
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.yf.exam.modules.exam.dto.request.ExamSaveReqDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamOnlineRespDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamReviewRespDTO;
|
||||
import com.yf.exam.modules.exam.entity.Exam;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -61,4 +62,12 @@ public interface ExamService extends IService<Exam> {
|
||||
* @return
|
||||
*/
|
||||
IPage<ExamReviewRespDTO> reviewPaging(PagingReqDTO<ExamDTO> reqDTO);
|
||||
|
||||
/**
|
||||
* 查询可预约考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
List<ExamDTO> getExamList(ExamDTO reqDTO);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
package com.yf.exam.modules.exam.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yf.exam.modules.exam.dto.ExamRegistrationDTO;
|
||||
import com.yf.exam.modules.exam.entity.ExamRegistration;
|
||||
import com.yf.exam.modules.exam.mapper.ExamRegistrationMapper;
|
||||
import com.yf.exam.modules.exam.service.ExamRegistrationService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @description: 考试报名业务实现类
|
||||
* @author: haown
|
||||
* @create: 2025-07-11 10:22
|
||||
**/
|
||||
@Service
|
||||
public class ExamRegistrationServiceImpl extends ServiceImpl<ExamRegistrationMapper, ExamRegistration> implements ExamRegistrationService {
|
||||
|
||||
@Override
|
||||
public void save(ExamRegistrationDTO reqDTO) {
|
||||
// ID
|
||||
String id = reqDTO.getId();
|
||||
|
||||
if(StringUtils.isBlank(id)){
|
||||
id = IdWorker.getIdStr();
|
||||
}
|
||||
|
||||
//复制参数
|
||||
ExamRegistration entity = new ExamRegistration();
|
||||
|
||||
// 复制基本数据
|
||||
BeanUtils.copyProperties(reqDTO, entity);
|
||||
entity.setId(id);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
}
|
||||
@ -19,7 +19,9 @@ import com.yf.exam.modules.exam.mapper.ExamMapper;
|
||||
import com.yf.exam.modules.exam.service.ExamDepartService;
|
||||
import com.yf.exam.modules.exam.service.ExamRepoService;
|
||||
import com.yf.exam.modules.exam.service.ExamService;
|
||||
import java.time.LocalDate;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -62,7 +64,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
|
||||
|
||||
// 复制基本数据
|
||||
BeanMapper.copy(reqDTO, entity);
|
||||
BeanUtils.copyProperties(reqDTO, entity);
|
||||
entity.setId(id);
|
||||
|
||||
// 修复状态
|
||||
@ -152,8 +154,19 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可预约考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@Override public List<ExamDTO> getExamList(ExamDTO reqDTO) {
|
||||
reqDTO.setExamType(2);
|
||||
reqDTO.setStartDate(LocalDate.now());
|
||||
List<ExamDTO> list = baseMapper.getExamList(reqDTO);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 计算分值
|
||||
* @param reqDTO
|
||||
*/
|
||||
|
||||
@ -59,7 +59,7 @@ public class SysUserController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "用户登录")
|
||||
@ApiOperation(value = "用户退出")
|
||||
@RequestMapping(value = "/logout", method = {RequestMethod.POST})
|
||||
public ApiRest logout(HttpServletRequest request) {
|
||||
String token = request.getHeader("token");
|
||||
|
||||
@ -2,10 +2,9 @@ package com.yf.exam.modules.sys.user.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -31,6 +30,9 @@ public class SysUserDTO implements Serializable {
|
||||
@ApiModelProperty(value = "真实姓名", required=true)
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "密码", required=true)
|
||||
private String password;
|
||||
|
||||
|
||||
@ -31,6 +31,9 @@ public class SysUserLoginDTO implements Serializable {
|
||||
@ApiModelProperty(value = "真实姓名", required=true)
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "手机号", required=true)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "角色列表", required=true)
|
||||
private String roleIds;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ public class SysUser extends Model<SysUser> {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
* 用户名(考生账号的用户名是身份证号)
|
||||
*/
|
||||
@TableField("user_name")
|
||||
private String userName;
|
||||
@ -41,6 +41,12 @@ public class SysUser extends Model<SysUser> {
|
||||
@TableField("real_name")
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@TableField("phone")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
|
||||
@ -192,7 +192,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
int count = this.count(wrapper);
|
||||
|
||||
if(count > 0){
|
||||
throw new ServiceException(1, "用户名已存在,换一个吧!");
|
||||
throw new ServiceException(1, "您已注册过该系统,请直接登录!");
|
||||
}
|
||||
|
||||
|
||||
@ -201,6 +201,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
user.setId(IdWorker.getIdStr());
|
||||
user.setUserName(reqDTO.getUserName());
|
||||
user.setRealName(reqDTO.getRealName());
|
||||
user.setPhone(reqDTO.getPhone());
|
||||
PassInfo passInfo = PassHandler.buildPassword(reqDTO.getPassword());
|
||||
user.setPassword(passInfo.getPassword());
|
||||
user.setSalt(passInfo.getSalt());
|
||||
|
||||
@ -4,7 +4,7 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.16.64:3306/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://8.131.93.145:54081/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 1qaz!@#$
|
||||
# druid相关配置
|
||||
@ -54,13 +54,27 @@ spring:
|
||||
conf:
|
||||
upload:
|
||||
# 物理文件存储位置,以/结束,windows已正斜杠,如:d:/exam-upload/
|
||||
dir: /Users/van/Documents/work/upload/
|
||||
dir: D:/exam-upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://localhost:8201/upload/file/
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
# 开启文档
|
||||
swagger:
|
||||
enable: true
|
||||
|
||||
@ -88,9 +88,24 @@ conf:
|
||||
dir: /data/upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://localhost:8101/upload/file/
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
|
||||
# 开启文档
|
||||
swagger:
|
||||
|
||||
@ -10,8 +10,10 @@
|
||||
<result column="open_type" property="openType" />
|
||||
<result column="state" property="state" />
|
||||
<result column="time_limit" property="timeLimit" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="start_date" property="startDate" />
|
||||
<result column="end_date" property="endDate" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="total_score" property="totalScore" />
|
||||
@ -21,7 +23,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`title`,`content`,`open_type`,`join_type`,`level`,`state`,`time_limit`,`start_time`,`end_time`,`create_time`,`update_time`,`total_score`,`total_time`,`qualify_score`
|
||||
`id`,`title`,`content`,`open_type`,`join_type`,`level`,`state`,`time_limit`,`start_date`,`end_date`,`start_time`,`end_time`,`create_time`,`update_time`,`total_score`,`total_time`,`qualify_score`
|
||||
</sql>
|
||||
|
||||
|
||||
@ -49,11 +51,11 @@
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.startTime!=null">
|
||||
AND start_time >= #{query.startTime}
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endTime!=null">
|
||||
AND end_time <= #{query.endTime}
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
@ -93,4 +95,23 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getExamList" resultMap="OnlineResultMap">
|
||||
SELECT * FROM el_exam
|
||||
where state = 0
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yf.exam.modules.exam.mapper.ExamRegistrationMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.yf.exam.modules.exam.entity.ExamRegistration">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="real_name" property="realName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="exam_id" property="examId" />
|
||||
<result column="title" property="title" />
|
||||
<result column="email" property="email" />
|
||||
<result column="address" property="address" />
|
||||
<result column="education" property="education" />
|
||||
<result column="graduate_school" property="graduateSchool" />
|
||||
<result column="major" property="major" />
|
||||
<result column="reg_type" property="regType" />
|
||||
<result column="train_institution" property="trainInstitution" />
|
||||
<result column="train_start_date" property="trainStartDate" />
|
||||
<result column="train_end_date" property="trainEndDate" />
|
||||
<result column="card_front" property="cardFront" />
|
||||
<result column="card_back" property="cardBack" />
|
||||
<result column="card_copy" property="cardCopy" />
|
||||
<result column="photo" property="photo" />
|
||||
<result column="certificate" property="certificate" />
|
||||
<result column="physical_report" property="physicalReport" />
|
||||
<result column="sign_picture" property="signPicture" />
|
||||
<result column="reg_time" property="regTime" />
|
||||
<result column="exam_state" property="examState" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,user_name,real_name,phone,exam_id,title,email,address,education,graduate_school,major,reg_type,
|
||||
train_institution,train_start_date,train_end_date,card_front,card_back,card_copy,photo,certificate,physical_report,sign_picture,
|
||||
reg_time,exam_state,create_time,update_time
|
||||
</sql>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -7,6 +7,7 @@
|
||||
<id column="id" property="id" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="real_name" property="realName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="password" property="password" />
|
||||
<result column="salt" property="salt" />
|
||||
<result column="role_ids" property="roleIds" />
|
||||
@ -18,7 +19,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_name`,`real_name`,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
`id`,`user_name`,`real_name`,phone,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -4,7 +4,7 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.16.64:3306/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://8.131.93.145:54081/yf_exam_lite?useSSL=false&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 1qaz!@#$
|
||||
# druid相关配置
|
||||
@ -54,13 +54,27 @@ spring:
|
||||
conf:
|
||||
upload:
|
||||
# 物理文件存储位置,以/结束,windows已正斜杠,如:d:/exam-upload/
|
||||
dir: /Users/van/Documents/work/upload/
|
||||
dir: D:/exam-upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://localhost:8201/upload/file/
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
# 开启文档
|
||||
swagger:
|
||||
enable: true
|
||||
|
||||
@ -88,9 +88,24 @@ conf:
|
||||
dir: /data/upload/
|
||||
# 访问地址,注意不要去除/upload/file/,此节点为虚拟标识符
|
||||
# 如:http://localhost:8101/upload/file/exam.jpg,对应物理文件为:/data/upload/exam.jpg
|
||||
url: http://localhost:8101/upload/file/
|
||||
url: http://8.131.93.145:54012/upload/file/
|
||||
# 允许上传的文件后缀
|
||||
allow-extensions: jpg,jpeg,png
|
||||
folder:
|
||||
# 身份证正面存储文件夹名称
|
||||
card_front_url: cardfront/
|
||||
# 身份证背面存储文件夹名称
|
||||
card_back_url: cardback/
|
||||
# 身份证正反面复印件
|
||||
card_copy_url: cardcopy/
|
||||
# 证件照
|
||||
photo_url: photo/
|
||||
# 学历证明
|
||||
certificate_url: certificate/
|
||||
# 体检报告
|
||||
physical_report_url: physicalreport/
|
||||
# 签名图片
|
||||
sign_picture_url: signpicture/
|
||||
|
||||
# 开启文档
|
||||
swagger:
|
||||
|
||||
@ -10,8 +10,10 @@
|
||||
<result column="open_type" property="openType" />
|
||||
<result column="state" property="state" />
|
||||
<result column="time_limit" property="timeLimit" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="start_date" property="startDate" />
|
||||
<result column="end_date" property="endDate" />
|
||||
<result column="start_time" property="startTime" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="total_score" property="totalScore" />
|
||||
@ -21,7 +23,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`title`,`content`,`open_type`,`join_type`,`level`,`state`,`time_limit`,`start_time`,`end_time`,`create_time`,`update_time`,`total_score`,`total_time`,`qualify_score`
|
||||
`id`,`title`,`content`,`open_type`,`join_type`,`level`,`state`,`time_limit`,`start_date`,`end_date`,`start_time`,`end_time`,`create_time`,`update_time`,`total_score`,`total_time`,`qualify_score`
|
||||
</sql>
|
||||
|
||||
|
||||
@ -49,11 +51,11 @@
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.startTime!=null">
|
||||
AND start_time >= #{query.startTime}
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endTime!=null">
|
||||
AND end_time <= #{query.endTime}
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
@ -93,4 +95,23 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getExamList" resultMap="OnlineResultMap">
|
||||
SELECT * FROM el_exam
|
||||
where state = 0
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
<id column="id" property="id" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="real_name" property="realName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="password" property="password" />
|
||||
<result column="salt" property="salt" />
|
||||
<result column="role_ids" property="roleIds" />
|
||||
@ -18,7 +19,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`,`user_name`,`real_name`,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
`id`,`user_name`,`real_name`,phone,`password`,`salt`,`role_ids`,`depart_id`,`create_time`,`update_time`,`state`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user